diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-07-04 15:43:32 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-07-08 11:36:43 +0200 |
commit | 4fbeb19d53cc3ef2da4bd1fd89a5dc9ac04add3a (patch) | |
tree | bdb18f740589b8add1bd56b54fe349857d97da8b /fs/ncpfs | |
parent | locks: move file_lock_list to a set of percpu hlist_heads and convert file_lo... (diff) | |
download | linux-4fbeb19d53cc3ef2da4bd1fd89a5dc9ac04add3a.tar.xz linux-4fbeb19d53cc3ef2da4bd1fd89a5dc9ac04add3a.zip |
ncpfs: fix error return code in ncp_parse_options()
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>
Diffstat (limited to 'fs/ncpfs')
-rw-r--r-- | fs/ncpfs/inode.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 0765ad12c382..4659da67e7f6 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c @@ -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; |