aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sr_ioctl.c
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-01-16 10:31:18 -0500
committer <jejb@mulgrave.il.steeleye.com>2006-02-27 23:55:02 -0500
commit24669f75a3231fa37444977c92d1f4838bec1233 (patch)
tree3b64076b7d031aa31b95caeb512fb7e68b5fd28f /drivers/scsi/sr_ioctl.c
parentb9a33cebac70d6f67a769ce8d4078fee2b254ada (diff)
[SCSI] SCSI core kmalloc2kzalloc
Change the core SCSI code to use kzalloc rather than kmalloc+memset where possible. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sr_ioctl.c')
-rw-r--r--drivers/scsi/sr_ioctl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
index 5d02ff4db6cc..03fbc4b44473 100644
--- a/drivers/scsi/sr_ioctl.c
+++ b/drivers/scsi/sr_ioctl.c
@@ -44,11 +44,10 @@ static int sr_read_tochdr(struct cdrom_device_info *cdi,
44 int result; 44 int result;
45 unsigned char *buffer; 45 unsigned char *buffer;
46 46
47 buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); 47 buffer = kzalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
48 if (!buffer) 48 if (!buffer)
49 return -ENOMEM; 49 return -ENOMEM;
50 50
51 memset(&cgc, 0, sizeof(struct packet_command));
52 cgc.timeout = IOCTL_TIMEOUT; 51 cgc.timeout = IOCTL_TIMEOUT;
53 cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP; 52 cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
54 cgc.cmd[8] = 12; /* LSB of length */ 53 cgc.cmd[8] = 12; /* LSB of length */
@@ -74,11 +73,10 @@ static int sr_read_tocentry(struct cdrom_device_info *cdi,
74 int result; 73 int result;
75 unsigned char *buffer; 74 unsigned char *buffer;
76 75
77 buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); 76 buffer = kzalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
78 if (!buffer) 77 if (!buffer)
79 return -ENOMEM; 78 return -ENOMEM;
80 79
81 memset(&cgc, 0, sizeof(struct packet_command));
82 cgc.timeout = IOCTL_TIMEOUT; 80 cgc.timeout = IOCTL_TIMEOUT;
83 cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP; 81 cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
84 cgc.cmd[1] |= (tocentry->cdte_format == CDROM_MSF) ? 0x02 : 0; 82 cgc.cmd[1] |= (tocentry->cdte_format == CDROM_MSF) ? 0x02 : 0;