Commit 80422738 authored by Kay Sievers's avatar Kay Sievers Committed by Greg Kroah-Hartman

devtmpfs: unlock mutex in case of string allocation error

Reported-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0787fdf7
......@@ -101,8 +101,10 @@ static int create_path(const char *nodepath)
/* parent directories do not exist, create them */
path = kstrdup(nodepath, GFP_KERNEL);
if (!path)
return -ENOMEM;
if (!path) {
err = -ENOMEM;
goto out;
}
s = path;
for (;;) {
s = strchr(s, '/');
......@@ -117,6 +119,7 @@ static int create_path(const char *nodepath)
}
kfree(path);
}
out:
mutex_unlock(&dirlock);
return err;
}
......
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