diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_cfdc.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_cfdc.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/s390/scsi/zfcp_cfdc.c b/drivers/s390/scsi/zfcp_cfdc.c index 1a2db0a35737..fcbd2b756da4 100644 --- a/drivers/s390/scsi/zfcp_cfdc.c +++ b/drivers/s390/scsi/zfcp_cfdc.c | |||
@@ -189,18 +189,12 @@ static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command, | |||
189 | if (!fsf_cfdc) | 189 | if (!fsf_cfdc) |
190 | return -ENOMEM; | 190 | return -ENOMEM; |
191 | 191 | ||
192 | data = kmalloc(sizeof(struct zfcp_cfdc_data), GFP_KERNEL); | 192 | data = memdup_user(data_user, sizeof(*data_user)); |
193 | if (!data) { | 193 | if (IS_ERR(data)) { |
194 | retval = -ENOMEM; | 194 | retval = PTR_ERR(data); |
195 | goto no_mem_sense; | 195 | goto no_mem_sense; |
196 | } | 196 | } |
197 | 197 | ||
198 | retval = copy_from_user(data, data_user, sizeof(*data)); | ||
199 | if (retval) { | ||
200 | retval = -EFAULT; | ||
201 | goto free_buffer; | ||
202 | } | ||
203 | |||
204 | if (data->signature != 0xCFDCACDF) { | 198 | if (data->signature != 0xCFDCACDF) { |
205 | retval = -EINVAL; | 199 | retval = -EINVAL; |
206 | goto free_buffer; | 200 | goto free_buffer; |