Skip to contentSkip to conversation

Remove incorrect unlock_kernel from allocation failure path in coda_open

PATCH In review Josh Triplett 2 participants 2 messages Jul 24, 2006 – Jul 25, 2006 Coda file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove incorrect unlock_kernel from allocation failure path in coda_open

Commit 398c53a757702e1e3a7a2c24860c7ad26acb53ed (in the historical GIT tree) moved the lock_kernel() in coda_open after the allocation of a coda_file_info struct, but left an unlock_kernel() in the allocation failure error path; remove it.

---
 fs/coda/file.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
fs/coda/file.c +1 -3
index cc66c68..dbfbcfa 100644
@@ -136,10 +136,8 @@ int coda_open(struct inode *coda_inode, 
 	coda_vfs_stat.open++;
 
 	cfi = kmalloc(sizeof(struct coda_file_info), GFP_KERNEL);
-	if (!cfi) {
-		unlock_kernel();
+	if (!cfi)
 		return -ENOMEM;
-	}
 
 	lock_kernel();
 
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Josh Triplett

Commit 398c53a757702e1e3a7a2c24860c7ad26acb53ed (in the historical GIT tree) moved the lock_kernel() in coda_open after the allocation of a coda_file_info struct, but left an unlock_kernel() in the allocation failure error path; remove it.

---

Totally correct fix, I actually thought I already sent a patch for the same problem upstream. I should dig through my local trees to check if anything else fell through the cracks.

Jan