提交 6db27dd9 编写于 作者: J Jim Meyering 提交者: Linus Torvalds

affs: handle match_strdup failure

fs/affs/super.c (parse_options): Remove useless initialization.  Handle
match_strdup failure.
Signed-off-by: NJim Meyering <meyering@redhat.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 61d64576
...@@ -199,7 +199,6 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s ...@@ -199,7 +199,6 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
case Opt_prefix: case Opt_prefix:
/* Free any previous prefix */ /* Free any previous prefix */
kfree(*prefix); kfree(*prefix);
*prefix = NULL;
*prefix = match_strdup(&args[0]); *prefix = match_strdup(&args[0]);
if (!*prefix) if (!*prefix)
return 0; return 0;
...@@ -233,6 +232,8 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s ...@@ -233,6 +232,8 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
break; break;
case Opt_volume: { case Opt_volume: {
char *vol = match_strdup(&args[0]); char *vol = match_strdup(&args[0]);
if (!vol)
return 0;
strlcpy(volume, vol, 32); strlcpy(volume, vol, 32);
kfree(vol); kfree(vol);
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册