Skip to content

Commit

Permalink
devtmpfs: missing initialialization in never-hit case
Browse files Browse the repository at this point in the history
create_path() on something without a single / in it will return err
without initializing it.  It actually can't happen (we call that thing
only if create on the same path returns -ENOENT, which won't happen
happen for single-component path), but in this case initializing err
to 0 is more than making compiler to STFU - would be the right thing
to return on such paths; the function creates a parent directory of
given pathname and in that case it has no work to do...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jul 28, 2011
1 parent d6b722a commit 9d108d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/devtmpfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static int create_path(const char *nodepath)
{
char *path;
char *s;
int err;
int err = 0;

/* parent directories do not exist, create them */
path = kstrdup(nodepath, GFP_KERNEL);
Expand Down

0 comments on commit 9d108d2

Please sign in to comment.