aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndreas Herrmann <aherrman@de.ibm.com>2005-06-13 07:22:25 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-06-13 22:34:35 -0400
commitcd8a383ebc93f8ded9cefee53a337542c3aacad7 (patch)
treef5a86536382783893f88df2ed082fec11d391285 /drivers
parent1db2c9c0931a53fe013db55fd2ff58859db31e8d (diff)
[SCSI] zfcp: fix module parameter parsing
From: Heiko Carstens <heiko.carstens@de.ibm.com> Fixes module parameter parsing for "device" parameter. The original module parameter was changed while parsing it. This corrupted the output in sysfs (/sys/module/zfcp/parameters/device). Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index c999042dae15..e17b4d58a9f6 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -218,13 +218,20 @@ zfcp_in_els_dbf_event(struct zfcp_adapter *adapter, const char *text,
218 * Parse "device=..." parameter string. 218 * Parse "device=..." parameter string.
219 */ 219 */
220static int __init 220static int __init
221zfcp_device_setup(char *str) 221zfcp_device_setup(char *devstr)
222{ 222{
223 char *tmp; 223 char *tmp, *str;
224 size_t len;
224 225
225 if (!str) 226 if (!devstr)
226 return 0; 227 return 0;
227 228
229 len = strlen(devstr) + 1;
230 str = (char *) kmalloc(len, GFP_KERNEL);
231 if (!str)
232 goto err_out;
233 memcpy(str, devstr, len);
234
228 tmp = strchr(str, ','); 235 tmp = strchr(str, ',');
229 if (!tmp) 236 if (!tmp)
230 goto err_out; 237 goto err_out;
@@ -241,10 +248,12 @@ zfcp_device_setup(char *str)
241 zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0); 248 zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0);
242 if (*tmp != '\0') 249 if (*tmp != '\0')
243 goto err_out; 250 goto err_out;
251 kfree(str);
244 return 1; 252 return 1;
245 253
246 err_out: 254 err_out:
247 ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str); 255 ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str);
256 kfree(str);
248 return 0; 257 return 0;
249} 258}
250 259