X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fscsi%2F3w-9xxx.c;h=9f75c87c389de54cfa7d8af0bd69a8815d500d57;hb=1be35e94e1da3669db492995cd2c8b1a37016b11;hp=2bac40c0e836c26dfc4248679a383e8344998169;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 2bac40c0e..9f75c87c3 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -619,7 +619,6 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int u32 current_time_ms; TW_Device_Extension *tw_dev = twa_device_extension_list[iminor(inode)]; int retval = TW_IOCTL_ERROR_OS_EFAULT; - void __user *argp = (void __user *)arg; /* Only let one of these through at a time */ if (down_interruptible(&tw_dev->ioctl_sem)) { @@ -628,7 +627,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int } /* First copy down the driver command */ - if (copy_from_user(&driver_command, argp, sizeof(TW_Ioctl_Driver_Command))) + if (copy_from_user(&driver_command, (void *)arg, sizeof(TW_Ioctl_Driver_Command))) goto out2; /* Check data buffer size */ @@ -650,7 +649,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int tw_ioctl = (TW_Ioctl_Buf_Apache *)cpu_addr; /* Now copy down the entire ioctl */ - if (copy_from_user(tw_ioctl, argp, driver_command.buffer_length + sizeof(TW_Ioctl_Buf_Apache) - 1)) + if (copy_from_user(tw_ioctl, (void *)arg, driver_command.buffer_length + sizeof(TW_Ioctl_Buf_Apache) - 1)) goto out3; /* See which ioctl we are doing */ @@ -660,7 +659,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int twa_get_request_id(tw_dev, &request_id); /* Flag internal command */ - tw_dev->srb[request_id] = NULL; + tw_dev->srb[request_id] = 0; /* Flag chrdev ioctl */ tw_dev->chrdev_request_id = request_id; @@ -845,7 +844,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int } /* Now copy the entire response to userspace */ - if (copy_to_user(argp, tw_ioctl, sizeof(TW_Ioctl_Buf_Apache) + driver_command.buffer_length - 1) == 0) + if (copy_to_user((void *)arg, tw_ioctl, sizeof(TW_Ioctl_Buf_Apache) + driver_command.buffer_length - 1) == 0) retval = 0; out3: /* Now free ioctl buf memory */