From: Andreas Herrmann Date: Mon, 13 Jun 2005 11:22:25 +0000 (+0200) Subject: [SCSI] zfcp: fix module parameter parsing X-Git-Tag: v2.6.13-rc1~90^2~583^2~62^2^2~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd8a383ebc93f8ded9cefee53a337542c3aacad7;p=linux-2.6 [SCSI] zfcp: fix module parameter parsing From: Heiko Carstens 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 Signed-off-by: James Bottomley --- diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index c999042dae..e17b4d58a9 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; }