summaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorAndreas Herrmann <aherrman@de.ibm.com>2005-06-13 13:22:25 +0200
committerJames Bottomley <jejb@mulgrave.(none)>2005-06-13 21:34:35 -0500
commitcd8a383ebc93f8ded9cefee53a337542c3aacad7 (patch)
treef5a86536382783893f88df2ed082fec11d391285 /drivers/s390
parent1db2c9c0931a53fe013db55fd2ff58859db31e8d (diff)
downloadop-kernel-dev-cd8a383ebc93f8ded9cefee53a337542c3aacad7.zip
op-kernel-dev-cd8a383ebc93f8ded9cefee53a337542c3aacad7.tar.gz
[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/s390')
-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 c999042..e17b4d5 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,
* Parse "device=..." parameter string.
*/
static int __init
-zfcp_device_setup(char *str)
+zfcp_device_setup(char *devstr)
{
- char *tmp;
+ char *tmp, *str;
+ size_t len;
- if (!str)
+ if (!devstr)
return 0;
+ len = strlen(devstr) + 1;
+ str = (char *) kmalloc(len, GFP_KERNEL);
+ if (!str)
+ goto err_out;
+ memcpy(str, devstr, len);
+
tmp = strchr(str, ',');
if (!tmp)
goto err_out;
@@ -241,10 +248,12 @@ zfcp_device_setup(char *str)
zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0);
if (*tmp != '\0')
goto err_out;
+ kfree(str);
return 1;
err_out:
ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str);
+ kfree(str);
return 0;
}
OpenPOWER on IntegriCloud