Skip to contentSkip to conversation

debugfs: fix double unlock in open_proxy_open()

PATCH In review Nicolai Stange 1 participant 4 messages Mar 12, 2016 – Mar 22, 2016 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 debugfs: fix double unlock in open_proxy_open()

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.

---
 fs/debugfs/file.c | 1 -
 1 file changed, 1 deletion(-)
fs/debugfs/file.c +0 -1
index 6a4b667..9c1c9a0 100644
@@ -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;
 	}
Signature · 1 line
2.7.2
#1 lore raw
Quoted 3 lines · Nicolai Stange

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.

This one has been reported by Rasmus Villemoes:

http://lkml.kernel.org/g/[email protected]

Thank you very much!

Nicolai