X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fscsi%2Fscsi_ioctl.c;h=0bba7d8eebb0a000ab2a89169cc7923aab3d748b;hb=387f96b4d9391bf3ce6928fb9cd90c9c7df37291;hp=b7fddac813474c0903d37d88e6f6f7ec03b092f5;hpb=142e27fc8a3619471669d6241784eec9167c47d1;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index b7fddac8134..0bba7d8eebb 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, break; } default: /* Fall through for non-removable media */ - printk(KERN_INFO "ioctl_internal_command: <%d %d %d " - "%d> return code = %x\n", - sdev->host->host_no, - sdev->channel, - sdev->id, - sdev->lun, - result); + sdev_printk(KERN_INFO, sdev, + "ioctl_internal_command return code = %x\n", + result); scsi_print_sense_hdr(" ", &sshdr); break; } @@ -205,7 +201,8 @@ int scsi_ioctl_send_command(struct scsi_device *sdev, unsigned int inlen, outlen, cmdlen; unsigned int needed, buf_needed; int timeout, retries, result; - int data_direction, gfp_mask = GFP_KERNEL; + int data_direction; + gfp_t gfp_mask = GFP_KERNEL; if (!sic) return -EINVAL; @@ -281,7 +278,7 @@ int scsi_ioctl_send_command(struct scsi_device *sdev, * Obtain the data to be sent to the device (if any). */ - if(copy_from_user(buf, cmd_in + cmdlen, inlen)) + if(inlen && copy_from_user(buf, cmd_in + cmdlen, inlen)) goto error; switch (opcode) { @@ -325,7 +322,7 @@ int scsi_ioctl_send_command(struct scsi_device *sdev, if (copy_to_user(cmd_in, sense, sb_len)) result = -EFAULT; } else { - if (copy_to_user(cmd_in, buf, outlen)) + if (outlen && copy_to_user(cmd_in, buf, outlen)) result = -EFAULT; } @@ -458,7 +455,7 @@ int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, * error processing, as long as the device was opened * non-blocking */ if (filp && filp->f_flags & O_NONBLOCK) { - if (sdev->host->shost_state == SHOST_RECOVERY) + if (scsi_host_in_recovery(sdev->host)) return -ENODEV; } else if (!scsi_block_when_processing_errors(sdev)) return -ENODEV;