diff options
author | 2010-07-16 15:37:34 +0200 | |
---|---|---|
committer | 2010-07-28 09:48:45 -0500 | |
commit | 674c3a993c278b7469e1cf12bfc13e6838dfd877 (patch) | |
tree | 4b52c44b3f9f9dc8f3a0456cf5a391564196dd5d /drivers/s390/scsi/zfcp_aux.c | |
parent | [SCSI] zfcp: Fix retry after failed "open port" erp action (diff) | |
download | linux-674c3a993c278b7469e1cf12bfc13e6838dfd877.tar.gz linux-674c3a993c278b7469e1cf12bfc13e6838dfd877.tar.bz2 linux-674c3a993c278b7469e1cf12bfc13e6838dfd877.zip |
[SCSI] zfcp: Use memdup_user and kstrdup
Use the functions memdup_user and kstrdup to allocate memory and copy
the data in one step, saving some lines of code.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_aux.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 6e9c7f33e276..7c01c4c3f6b9 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -98,13 +98,11 @@ static void __init zfcp_init_device_setup(char *devstr) u64 wwpn, lun; /* duplicate devstr and keep the original for sysfs presentation*/ - str_saved = kmalloc(strlen(devstr) + 1, GFP_KERNEL); + str_saved = kstrdup(devstr, GFP_KERNEL); str = str_saved; if (!str) return; - strcpy(str, devstr); - token = strsep(&str, ","); if (!token || strlen(token) >= ZFCP_BUS_ID_SIZE) goto err_out; |