]> err.no Git - linux-2.6/blobdiff - drivers/scsi/sr_ioctl.c
Merge branch 'for-linus' of git://www.atmel.no/~hskinnemoen/linux/kernel/avr32
[linux-2.6] / drivers / scsi / sr_ioctl.c
index 03fbc4b44473814b917259b8a3aec9f518ddfd05..d1268cb46837b258cd721f992546c7f1084d6345 100644 (file)
@@ -44,10 +44,11 @@ static int sr_read_tochdr(struct cdrom_device_info *cdi,
        int result;
        unsigned char *buffer;
 
-       buffer = kzalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
+       buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
        if (!buffer)
                return -ENOMEM;
 
+       memset(&cgc, 0, sizeof(struct packet_command));
        cgc.timeout = IOCTL_TIMEOUT;
        cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
        cgc.cmd[8] = 12;                /* LSB of length */
@@ -73,10 +74,11 @@ static int sr_read_tocentry(struct cdrom_device_info *cdi,
        int result;
        unsigned char *buffer;
 
-       buffer = kzalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
+       buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
        if (!buffer)
                return -ENOMEM;
 
+       memset(&cgc, 0, sizeof(struct packet_command));
        cgc.timeout = IOCTL_TIMEOUT;
        cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
        cgc.cmd[1] |= (tocentry->cdte_format == CDROM_MSF) ? 0x02 : 0;
@@ -190,7 +192,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
        SDev = cd->device;
 
        if (!sense) {
-               sense = kmalloc(sizeof(*sense), GFP_KERNEL);
+               sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
                if (!sense) {
                        err = -ENOMEM;
                        goto out;
@@ -560,22 +562,3 @@ int sr_is_xa(Scsi_CD *cd)
 #endif
        return is_xa;
 }
-
-int sr_dev_ioctl(struct cdrom_device_info *cdi,
-                unsigned int cmd, unsigned long arg)
-{
-       Scsi_CD *cd = cdi->handle;
-       int ret;
-       
-       ret = scsi_nonblockable_ioctl(cd->device, cmd,
-                                     (void __user *)arg, NULL);
-       /*
-        * ENODEV means that we didn't recognise the ioctl, or that we
-        * cannot execute it in the current device state.  In either
-        * case fall through to scsi_ioctl, which will return ENDOEV again
-        * if it doesn't recognise the ioctl
-        */
-       if (ret != -ENODEV)
-               return ret;
-       return scsi_ioctl(cd->device, cmd, (void __user *)arg);
-}