From patchwork Mon Jun 13 23:42:00 2016 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: 9174765 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 BF3AF6075D for ; Tue, 14 Jun 2016 00:28:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B079E27D45 for ; Tue, 14 Jun 2016 00:28:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A242228047; Tue, 14 Jun 2016 00:28:49 +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_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B62727D45 for ; Tue, 14 Jun 2016 00:28:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D48C66E694; Tue, 14 Jun 2016 00:28:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 918 seconds by postgrey-1.35 at gabe; Mon, 13 Jun 2016 23:57:50 UTC Received: from m12-13.163.com (m12-13.163.com [220.181.12.13]) by gabe.freedesktop.org (Postfix) with ESMTP id 55FC76E2DA; Mon, 13 Jun 2016 23:57:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=WmpLt VPQWSoQ/dta1SYpsiQL+G3HEI/qqHsIKvluDTw=; b=OGhc7V1d8pVV1MYiP5TQm VEIPRDdu8nF4MDWYKZjs5EWYbYKtMlVI7+8K1p21V0PFX+TmR1bLSwv0VXzTVWrB zLHEsb3wm/6ZYSvvbYaTqt6GmESC8UrCsAGJDBiloaUvOfNyqSkS/Ama0TnAC9wX QQpk/+JsV8t3STVWF8XL7Y= Received: from localhost.localdomain.localdomain (unknown [180.102.102.213]) by smtp9 (Coremail) with SMTP id DcCowAAnIdTJRF9X9advAA--.5933S3; Tue, 14 Jun 2016 07:42:04 +0800 (CST) From: weiyj_lk@163.com To: Daniel Vetter , Jani Nikula , David Airlie Subject: [PATCH] drm/i915: Fix missing unlock on error in i915_ppgtt_info() Date: Mon, 13 Jun 2016 23:42:00 +0000 Message-Id: <1465861320-26221-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 X-CM-TRANSID: DcCowAAnIdTJRF9X9advAA--.5933S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4DKF1DZFy7AryrKw45Wrg_yoWkWwbEk3 95ZrnrGrWUCFn0gF12kr15ZFWFyayY9F48X3WFvrW3Jr12kws8GrZ3urykXr48WFsrua4D J3Z5uFn5ZrnrKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnHGQDUUUUU== X-Originating-IP: [180.102.102.213] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiMAyH1lWBWiKlLgAAsK X-Mailman-Approved-At: Tue, 14 Jun 2016 00:28:22 +0000 Cc: Wei Yongjun , intel-gfx@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 i915_ppgtt_info() in the error handling case. Fixes: 1d2ac403ae3b(drm: Protect dev->filelist with its own mutex) Signed-off-by: Wei Yongjun --- drivers/gpu/drm/i915/i915_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 3269033..1035468 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -2365,16 +2365,16 @@ static int i915_ppgtt_info(struct seq_file *m, void *data) task = get_pid_task(file->pid, PIDTYPE_PID); if (!task) { ret = -ESRCH; - goto out_put; + goto out_unlock; } seq_printf(m, "\nproc: %s\n", task->comm); put_task_struct(task); idr_for_each(&file_priv->context_idr, per_file_ctx, (void *)(unsigned long)m); } +out_unlock: mutex_unlock(&dev->filelist_mutex); -out_put: intel_runtime_pm_put(dev_priv); mutex_unlock(&dev->struct_mutex);