[2.6.22.2 review 80/84] sysfs: release mutex when kmalloc() failedin sysfs_open_file().

From: Greg KH
Date: Tue Aug 07 2007 - 17:29:57 EST



From: YOSHIFUJI Hideaki <yoshfuji@xxxxxxxxxxxxxx>



Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>


---
fs/sysfs/file.c | 1 +
1 file changed, 1 insertion(+)

--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -283,6 +283,7 @@ static int sysfs_open_file(struct inode
mutex_lock(&inode->i_mutex);
if (!(set = inode->i_private)) {
if (!(set = inode->i_private = kmalloc(sizeof(struct sysfs_buffer_collection), GFP_KERNEL))) {
+ mutex_unlock(&inode->i_mutex);
error = -ENOMEM;
goto Done;
} else {

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/