From patchwork Fri Dec 5 00:55:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 5441051 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BA18FBEEA8 for ; Fri, 5 Dec 2014 01:11:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D615D20353 for ; Fri, 5 Dec 2014 01:11:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0671D20254 for ; Fri, 5 Dec 2014 01:11:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03F9D6E53B; Thu, 4 Dec 2014 17:11:49 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org X-Greylist: delayed 930 seconds by postgrey-1.34 at gabe; Thu, 04 Dec 2014 17:11:46 PST Received: from m12-13.163.com (m12-13.163.com [220.181.12.13]) by gabe.freedesktop.org (Postfix) with ESMTP id CE11E6E51C; Thu, 4 Dec 2014 17:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=p+U0qWIlVa+D8/dG1u WHM3tlaAStnfJ9t0Hw+2nuv2A=; b=jOhCMobSoKW0TN/nXBfvW/tvHozdPOlI6R A2e0tEYXPkvgJLW/E1cZjZiZUP9EZaKjg15XmOYn2RJ3hUO4kM64tNbTBgwV+ZCi VI8yDpbNJN+wcbsnaI4QkF/mBPPdbrKftzKogVWmIs+Zh9LLOsdaTnHdxK1+Ly9g 63ALcLPko= Received: from localhost.localdomain.localdomain (unknown [49.77.206.164]) by smtp9 (Coremail) with SMTP id DcCowACHOGSiAoFU82fFAA--.958S2; Fri, 05 Dec 2014 08:56:04 +0800 (CST) X-Coremail-DSSMTP: 49.77.206.164 From: weiyj_lk@163.com To: Daniel Vetter , Jani Nikula , David Airlie Date: Fri, 5 Dec 2014 08:55:59 +0800 Message-Id: <1417740959-342-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 1.9.3 X-CM-TRANSID: DcCowACHOGSiAoFU82fFAA--.958S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4DKF1kZryUJw4DCrW7Arb_yoW3KFg_K3 yjvrnrWr9rCF4q9Fy3uFs0vFyavF98ZF4rXr10qa4fJrnFyryDW3s3ur1UXr4xCFWkWF4k X3Z5ZFn0vrn7CjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnov3UUUUUU== X-Originating-IP: [49.77.206.164] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiJRZZ1k9pIRiCRgAAsn Cc: Wei Yongjun , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [Intel-gfx] [PATCH -next] drm/i915: Fix missing unlock on error in i915_gem_init_hw() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Add the missing unlock before return from function i915_gem_init_hw() in the error handling case. Signed-off-by: Wei Yongjun --- drivers/gpu/drm/i915/i915_gem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index d2ba315..3eeb2d0 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -4879,8 +4879,10 @@ i915_gem_init_hw(struct drm_device *dev) i915_gem_init_swizzling(dev); ret = dev_priv->gt.init_rings(dev); - if (ret) + if (ret) { + mutex_unlock(&dev->struct_mutex); return ret; + } for (i = 0; i < NUM_L3_SLICES(dev); i++) i915_gem_l3_remap(&dev_priv->ring[RCS], i);