diff options
Diffstat (limited to 'net/9p/trans_fd.c')
-rw-r--r-- | net/9p/trans_fd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index be1cb909d8c0..31d0b05582a9 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c | |||
@@ -714,7 +714,7 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) | |||
714 | char *p; | 714 | char *p; |
715 | substring_t args[MAX_OPT_ARGS]; | 715 | substring_t args[MAX_OPT_ARGS]; |
716 | int option; | 716 | int option; |
717 | char *options; | 717 | char *options, *tmp_options; |
718 | int ret; | 718 | int ret; |
719 | 719 | ||
720 | opts->port = P9_PORT; | 720 | opts->port = P9_PORT; |
@@ -724,12 +724,13 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) | |||
724 | if (!params) | 724 | if (!params) |
725 | return 0; | 725 | return 0; |
726 | 726 | ||
727 | options = kstrdup(params, GFP_KERNEL); | 727 | tmp_options = kstrdup(params, GFP_KERNEL); |
728 | if (!options) { | 728 | if (!tmp_options) { |
729 | P9_DPRINTK(P9_DEBUG_ERROR, | 729 | P9_DPRINTK(P9_DEBUG_ERROR, |
730 | "failed to allocate copy of option string\n"); | 730 | "failed to allocate copy of option string\n"); |
731 | return -ENOMEM; | 731 | return -ENOMEM; |
732 | } | 732 | } |
733 | options = tmp_options; | ||
733 | 734 | ||
734 | while ((p = strsep(&options, ",")) != NULL) { | 735 | while ((p = strsep(&options, ",")) != NULL) { |
735 | int token; | 736 | int token; |
@@ -760,7 +761,8 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) | |||
760 | continue; | 761 | continue; |
761 | } | 762 | } |
762 | } | 763 | } |
763 | kfree(options); | 764 | |
765 | kfree(tmp_options); | ||
764 | return 0; | 766 | return 0; |
765 | } | 767 | } |
766 | 768 | ||