Commit 93ffc3e3 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by Greg Kroah-Hartman

sysfs: release mutex when kmalloc() failed in sysfs_open_file().

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 05b1ed79
......@@ -283,6 +283,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment