Message ID | 163513470696.40352.1069626993439788071.stgit@mickey.themaw.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] vfs: parse: deal with zero length string value | expand |
diff --git a/fs/fs_context.c b/fs/fs_context.c index b7e43a780a62..a949cceccbfd 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -175,9 +175,13 @@ int vfs_parse_fs_string(struct fs_context *fc, const char *key, }; if (value) { - param.string = kmemdup_nul(value, v_size, GFP_KERNEL); - if (!param.string) - return -ENOMEM; + if (!v_size) + param.string = NULL; + else { + param.string = kmemdup_nul(value, v_size, GFP_KERNEL); + if (!param.string) + return -ENOMEM; + } param.type = fs_value_is_string; }