]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ncpfs: fix error return code in ncp_parse_options()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 4 Jul 2013 13:43:32 +0000 (21:43 +0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 8 Jul 2013 09:36:43 +0000 (13:36 +0400)
Fix to return -EINVAL from the option parse error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ncpfs/inode.c

index 0765ad12c3827cf9822dacc1875cb64a957c9864..4659da67e7f6d0efa17f06934ed9f7200c3dadfd 100644 (file)
@@ -403,18 +403,24 @@ static int ncp_parse_options(struct ncp_mount_data_kernel *data, char *options)
                switch (optval) {
                        case 'u':
                                data->uid = make_kuid(current_user_ns(), optint);
-                               if (!uid_valid(data->uid))
+                               if (!uid_valid(data->uid)) {
+                                       ret = -EINVAL;
                                        goto err;
+                               }
                                break;
                        case 'g':
                                data->gid = make_kgid(current_user_ns(), optint);
-                               if (!gid_valid(data->gid))
+                               if (!gid_valid(data->gid)) {
+                                       ret = -EINVAL;
                                        goto err;
+                               }
                                break;
                        case 'o':
                                data->mounted_uid = make_kuid(current_user_ns(), optint);
-                               if (!uid_valid(data->mounted_uid))
+                               if (!uid_valid(data->mounted_uid)) {
+                                       ret = -EINVAL;
                                        goto err;
+                               }
                                break;
                        case 'm':
                                data->file_mode = optint;