Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753346AbcCLPJc (ORCPT ); Sat, 12 Mar 2016 10:09:32 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:34829 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752587AbcCLPJX (ORCPT ); Sat, 12 Mar 2016 10:09:23 -0500 From: Nicolai Stange To: Greg Kroah-Hartman Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org, Nicolai Stange Subject: [PATCH] debugfs: fix double unlock in open_proxy_open() Date: Sat, 12 Mar 2016 16:09:05 +0100 Message-Id: <1457795345-23014-1-git-send-email-nicstange@gmail.com> X-Mailer: git-send-email 2.7.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 709 Lines: 25 In case an open is racing with a debugfs file removal, the corresponding error path in open_proxy_open() releases its SRCU read side critical section twice, i.e. it does a double unlock. Fix that by purging the extra unlock operation. Signed-off-by: Nicolai Stange --- fs/debugfs/file.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 6a4b667..9c1c9a0 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -108,7 +108,6 @@ static int open_proxy_open(struct inode *inode, struct file *filp) r = debugfs_use_file_start(dentry, &srcu_idx); if (r) { - debugfs_use_file_finish(srcu_idx); r = -ENOENT; goto out; } -- 2.7.2