Skip to contentSkip to conversation

cifs: Fix double unlock bug in open_cached_dir()

PATCH New Dan Carpenter 1 participant 1 message May 5, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: Fix double unlock bug in open_cached_dir()

The "goto out;" also does mutex_unlock(&cfid->cfid_mutex) so delete this duplicate unlock.

Fixes 62adfb82c199 ("cifs: serialize initialization and cleanup of cfid")

---
To be honest I suspect that we're going to have to revert 62adfb82c199 ("cifs: serialize initialization and cleanup of cfid") instead of fixing it? So this patch might not be worth applying.

 fs/smb/client/cached_dir.c | 1 -
 1 file changed, 1 deletion(-)
fs/smb/client/cached_dir.c +0 -1
index 9e20e3dc2c03..3f4fe1ecdcaf 100644
@@ -238,7 +238,6 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
 	 */
 	npath = path_no_prefix(cifs_sb, path);
 	if (IS_ERR(npath)) {
-		mutex_unlock(&cfid->cfid_mutex);
 		rc = PTR_ERR(npath);
 		goto out;
 	}
Signature · 1 line
2.47.2