diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-27 22:27:33 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-27 22:27:33 -0400 |
commit | 9d108d25487bf958f8093409a4c0bee6169edba6 (patch) | |
tree | 14e9e96403ffcec690f77f9e6f99429a1a2e535c /drivers/base | |
parent | d6b722aa383a467a43d09ee38e866981abba08ab (diff) |
devtmpfs: missing initialialization in never-hit case
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>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/devtmpfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c index b89fffc1d777..33e1bed68fdd 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/base/devtmpfs.c | |||
@@ -166,7 +166,7 @@ static int create_path(const char *nodepath) | |||
166 | { | 166 | { |
167 | char *path; | 167 | char *path; |
168 | char *s; | 168 | char *s; |
169 | int err; | 169 | int err = 0; |
170 | 170 | ||
171 | /* parent directories do not exist, create them */ | 171 | /* parent directories do not exist, create them */ |
172 | path = kstrdup(nodepath, GFP_KERNEL); | 172 | path = kstrdup(nodepath, GFP_KERNEL); |