Commit b8100750 authored by Benoit Goby's avatar Benoit Goby Committed by Felipe Balbi

usb: gadget: FunctionFS: Fix missing braces in parse_opts

Add missing braces around an if block in ffs_fs_parse_opts. This broke
parsing the uid/gid mount options and causes mount to fail when using
uid/gid. This has been introduced by commit b9b73f7c (userns: Convert usb
functionfs to use kuid/kgid where appropriate) in 3.7.

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarBenoit Goby <benoit@android.com>
Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 6048e4c6
...@@ -1153,15 +1153,15 @@ static int ffs_fs_parse_opts(struct ffs_sb_fill_data *data, char *opts) ...@@ -1153,15 +1153,15 @@ static int ffs_fs_parse_opts(struct ffs_sb_fill_data *data, char *opts)
pr_err("%s: unmapped value: %lu\n", opts, value); pr_err("%s: unmapped value: %lu\n", opts, value);
return -EINVAL; return -EINVAL;
} }
} } else if (!memcmp(opts, "gid", 3)) {
else if (!memcmp(opts, "gid", 3))
data->perms.gid = make_kgid(current_user_ns(), value); data->perms.gid = make_kgid(current_user_ns(), value);
if (!gid_valid(data->perms.gid)) { if (!gid_valid(data->perms.gid)) {
pr_err("%s: unmapped value: %lu\n", opts, value); pr_err("%s: unmapped value: %lu\n", opts, value);
return -EINVAL; return -EINVAL;
} }
else } else {
goto invalid; goto invalid;
}
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment