Skip to content

Commit

Permalink
ncpfs: fix error return code in ncp_parse_options()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Al Viro committed Jul 8, 2013
1 parent 7012b02 commit 4fbeb19
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fs/ncpfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4fbeb19

Please sign in to comment.