btrfs: returning under lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This was found by smatch (http://repo.or.cz/w/smatch.git/)

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>

--- orig/fs/btrfs/transaction.c	2009-03-26 16:25:37.000000000 +0300
+++ devel/fs/btrfs/transaction.c	2009-03-26 16:26:36.000000000 +0300
@@ -914,8 +914,10 @@
 	}
 
 	pinned_copy = kmalloc(sizeof(*pinned_copy), GFP_NOFS);
-	if (!pinned_copy)
+	if (!pinned_copy) {
+		mutex_unlock(&root->fs_info->trans_mutex);
 		return -ENOMEM;
+	}
 
 	extent_io_tree_init(pinned_copy,
 			     root->fs_info->btree_inode->i_mapping, GFP_NOFS);
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux