diff options
Diffstat (limited to 'drivers/scsi/scsi_ioctl.c')
-rw-r--r-- | drivers/scsi/scsi_ioctl.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 6a3f6aae8a97..0bba7d8eebb0 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c | |||
@@ -122,13 +122,9 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, | |||
122 | break; | 122 | break; |
123 | } | 123 | } |
124 | default: /* Fall through for non-removable media */ | 124 | default: /* Fall through for non-removable media */ |
125 | printk(KERN_INFO "ioctl_internal_command: <%d %d %d " | 125 | sdev_printk(KERN_INFO, sdev, |
126 | "%d> return code = %x\n", | 126 | "ioctl_internal_command return code = %x\n", |
127 | sdev->host->host_no, | 127 | result); |
128 | sdev->channel, | ||
129 | sdev->id, | ||
130 | sdev->lun, | ||
131 | result); | ||
132 | scsi_print_sense_hdr(" ", &sshdr); | 128 | scsi_print_sense_hdr(" ", &sshdr); |
133 | break; | 129 | break; |
134 | } | 130 | } |
@@ -282,7 +278,7 @@ int scsi_ioctl_send_command(struct scsi_device *sdev, | |||
282 | * Obtain the data to be sent to the device (if any). | 278 | * Obtain the data to be sent to the device (if any). |
283 | */ | 279 | */ |
284 | 280 | ||
285 | if(copy_from_user(buf, cmd_in + cmdlen, inlen)) | 281 | if(inlen && copy_from_user(buf, cmd_in + cmdlen, inlen)) |
286 | goto error; | 282 | goto error; |
287 | 283 | ||
288 | switch (opcode) { | 284 | switch (opcode) { |
@@ -326,7 +322,7 @@ int scsi_ioctl_send_command(struct scsi_device *sdev, | |||
326 | if (copy_to_user(cmd_in, sense, sb_len)) | 322 | if (copy_to_user(cmd_in, sense, sb_len)) |
327 | result = -EFAULT; | 323 | result = -EFAULT; |
328 | } else { | 324 | } else { |
329 | if (copy_to_user(cmd_in, buf, outlen)) | 325 | if (outlen && copy_to_user(cmd_in, buf, outlen)) |
330 | result = -EFAULT; | 326 | result = -EFAULT; |
331 | } | 327 | } |
332 | 328 | ||