Skip to content
Snippets Groups Projects
Commit 80422738 authored by Kay Sievers's avatar Kay Sievers Committed by Greg Kroah-Hartman
Browse files

devtmpfs: unlock mutex in case of string allocation error

parent 0787fdf7
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment