diff options
| -rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 0f79f3af4f54..2889e5f2dfd3 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
| @@ -128,12 +128,13 @@ out_ccwdev: | |||
| 128 | static void __init zfcp_init_device_setup(char *devstr) | 128 | static void __init zfcp_init_device_setup(char *devstr) |
| 129 | { | 129 | { |
| 130 | char *token; | 130 | char *token; |
| 131 | char *str; | 131 | char *str, *str_saved; |
| 132 | char busid[ZFCP_BUS_ID_SIZE]; | 132 | char busid[ZFCP_BUS_ID_SIZE]; |
| 133 | u64 wwpn, lun; | 133 | u64 wwpn, lun; |
| 134 | 134 | ||
| 135 | /* duplicate devstr and keep the original for sysfs presentation*/ | 135 | /* duplicate devstr and keep the original for sysfs presentation*/ |
| 136 | str = kmalloc(strlen(devstr) + 1, GFP_KERNEL); | 136 | str_saved = kmalloc(strlen(devstr) + 1, GFP_KERNEL); |
| 137 | str = str_saved; | ||
| 137 | if (!str) | 138 | if (!str) |
| 138 | return; | 139 | return; |
| 139 | 140 | ||
| @@ -152,12 +153,12 @@ static void __init zfcp_init_device_setup(char *devstr) | |||
| 152 | if (!token || strict_strtoull(token, 0, (unsigned long long *) &lun)) | 153 | if (!token || strict_strtoull(token, 0, (unsigned long long *) &lun)) |
| 153 | goto err_out; | 154 | goto err_out; |
| 154 | 155 | ||
| 155 | kfree(str); | 156 | kfree(str_saved); |
| 156 | zfcp_init_device_configure(busid, wwpn, lun); | 157 | zfcp_init_device_configure(busid, wwpn, lun); |
| 157 | return; | 158 | return; |
| 158 | 159 | ||
| 159 | err_out: | 160 | err_out: |
| 160 | kfree(str); | 161 | kfree(str_saved); |
| 161 | pr_err("%s is not a valid SCSI device\n", devstr); | 162 | pr_err("%s is not a valid SCSI device\n", devstr); |
| 162 | } | 163 | } |
| 163 | 164 | ||
