From patchwork Wed Apr 12 00:31:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9676361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6220A601C3 for ; Wed, 12 Apr 2017 01:10:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4886928565 for ; Wed, 12 Apr 2017 01:10:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BBA328573; Wed, 12 Apr 2017 01:10:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CCCB128565 for ; Wed, 12 Apr 2017 01:10:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 26DD76E5C0; Wed, 12 Apr 2017 01:08:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5973F891A4; Wed, 12 Apr 2017 00:31:24 +0000 (UTC) Received: by mail-pg0-x242.google.com with SMTP id 81so2190846pgh.3; Tue, 11 Apr 2017 17:31:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eEng1sHcqPv049elTTNEOIw/Ee2J0iiXx8LsIcNCelQ=; b=FOQS0z5KxjBokDmN07s/TkVHl6j4qCdMML6Xn/Gc5Nf+3w3AvMwhHblOyfHPw+27aW rfGZphoQjDiIyqSX4aHKTDJ+1l0uzMyLLN/jfhQ+voShnL8pSrv8U49BgngViFaD9M75 eSB4lpTpuCqXDQS8XuYbYX9KJFO2PZRRkhlPcEPL3KFADSAE/fQEzPqEBBd+0RIa3MyO G/qY/fmz+QAK9Yh0XUtsB7zUrc+OUBdf7e5aqvSAZEIH9dVbp6zq7PYwqdLE/CYoprTM yZVrtejlc4LPHH/3auKykSrbyy1v9PaUbGSg0M/uGVFIRN5n/bQrUf4Kf4IgiusqA+nT gCdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eEng1sHcqPv049elTTNEOIw/Ee2J0iiXx8LsIcNCelQ=; b=oxDjHudyJi5wk1yduXS0Ptq8w0xZR2591ZqNx5eyNaWPZL9UKRF4e/TmavvtexInYa 4lCRtQ7RuoI8G0EdSE9JIng3/Z2AGwn/lZKacLpkxuR4WeMHfpZ2zCozYCUksQsyH+JE nd4GaIx2yl7a7p1umUwCPrqzoa5ooXdAH3Jvg5KtEoOzK1fMZSwknuseRYJ/dCkDaMXJ snHTgerymM7QQD2P98459jGpwxOmmBt1isn1ZMK5eZQlmD8tcDVYPAjW+5WXe+A0ir8E gjD+JerFltAdgC8ycX4td5zgS5xy7Gbjb3p9F+1LOo/5Xej0DWQh8irdThniRWRk258y M//g== X-Gm-Message-State: AN3rC/53CzRoXmgGqMyigvDaUsJXeA9DSp8Fd0zt69nWHYPxr8e3b+kSRwY4XrNMXJ9Vbg== X-Received: by 10.98.100.75 with SMTP id y72mr12973725pfb.44.1491957083976; Tue, 11 Apr 2017 17:31:23 -0700 (PDT) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id 128sm32568155pgi.49.2017.04.11.17.31.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 17:31:23 -0700 (PDT) From: Wei Yongjun To: Lucas Stach , Russell King , Christian Gmeiner , David Airlie Subject: [PATCH] drm/etnaviv: fix missing unlock on error in etnaviv_gpu_submit() Date: Wed, 12 Apr 2017 00:31:16 +0000 Message-Id: <20170412003116.30767-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 12 Apr 2017 01:08:13 +0000 Cc: Wei Yongjun , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Add the missing unlock before return from function etnaviv_gpu_submit() in the error handling case. Fixes: f3cd1b064f11 ("drm/etnaviv: (re-)protect fence allocation with GPU mutex") Signed-off-by: Wei Yongjun --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index da48819..e4a4d4c 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1317,7 +1317,7 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu, if (!fence) { event_free(gpu, event); ret = -ENOMEM; - goto out_pm_put; + goto out_unlok; } gpu->event[event].fence = fence; @@ -1357,6 +1357,7 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu, hangcheck_timer_reset(gpu); ret = 0; +out_unlok: mutex_unlock(&gpu->lock); out_pm_put: