diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ncpfs/inode.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 861d950ac99a..67a90bf795d5 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c | |||
@@ -327,6 +327,7 @@ static int ncp_parse_options(struct ncp_mount_data_kernel *data, char *options) | |||
327 | char *optarg; | 327 | char *optarg; |
328 | unsigned long optint; | 328 | unsigned long optint; |
329 | int version = 0; | 329 | int version = 0; |
330 | int ret; | ||
330 | 331 | ||
331 | data->flags = 0; | 332 | data->flags = 0; |
332 | data->int_flags = 0; | 333 | data->int_flags = 0; |
@@ -343,8 +344,9 @@ static int ncp_parse_options(struct ncp_mount_data_kernel *data, char *options) | |||
343 | data->mounted_vol[0] = 0; | 344 | data->mounted_vol[0] = 0; |
344 | 345 | ||
345 | while ((optval = ncp_getopt("ncpfs", &options, ncp_opts, NULL, &optarg, &optint)) != 0) { | 346 | while ((optval = ncp_getopt("ncpfs", &options, ncp_opts, NULL, &optarg, &optint)) != 0) { |
346 | if (optval < 0) | 347 | ret = optval; |
347 | return optval; | 348 | if (ret < 0) |
349 | goto err; | ||
348 | switch (optval) { | 350 | switch (optval) { |
349 | case 'u': | 351 | case 'u': |
350 | data->uid = optint; | 352 | data->uid = optint; |
@@ -380,18 +382,21 @@ static int ncp_parse_options(struct ncp_mount_data_kernel *data, char *options) | |||
380 | data->info_fd = optint; | 382 | data->info_fd = optint; |
381 | break; | 383 | break; |
382 | case 'v': | 384 | case 'v': |
383 | if (optint < NCP_MOUNT_VERSION_V4) { | 385 | ret = -ECHRNG; |
384 | return -ECHRNG; | 386 | if (optint < NCP_MOUNT_VERSION_V4) |
385 | } | 387 | goto err; |
386 | if (optint > NCP_MOUNT_VERSION_V5) { | 388 | if (optint > NCP_MOUNT_VERSION_V5) |
387 | return -ECHRNG; | 389 | goto err; |
388 | } | ||
389 | version = optint; | 390 | version = optint; |
390 | break; | 391 | break; |
391 | 392 | ||
392 | } | 393 | } |
393 | } | 394 | } |
394 | return 0; | 395 | return 0; |
396 | err: | ||
397 | put_pid(data->wdog_pid); | ||
398 | data->wdog_pid = NULL; | ||
399 | return ret; | ||
395 | } | 400 | } |
396 | 401 | ||
397 | static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) | 402 | static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) |
@@ -409,6 +414,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
409 | #endif | 414 | #endif |
410 | struct ncp_entry_info finfo; | 415 | struct ncp_entry_info finfo; |
411 | 416 | ||
417 | data.wdog_pid = NULL; | ||
412 | server = kzalloc(sizeof(struct ncp_server), GFP_KERNEL); | 418 | server = kzalloc(sizeof(struct ncp_server), GFP_KERNEL); |
413 | if (!server) | 419 | if (!server) |
414 | return -ENOMEM; | 420 | return -ENOMEM; |
@@ -679,6 +685,7 @@ out_fput: | |||
679 | */ | 685 | */ |
680 | fput(ncp_filp); | 686 | fput(ncp_filp); |
681 | out: | 687 | out: |
688 | put_pid(data.wdog_pid); | ||
682 | sb->s_fs_info = NULL; | 689 | sb->s_fs_info = NULL; |
683 | kfree(server); | 690 | kfree(server); |
684 | return error; | 691 | return error; |