aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 71ec9e664383..1b0fd31c57c3 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -996,13 +996,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
996 status = -EINVAL; 996 status = -EINVAL;
997 goto cleanup1; 997 goto cleanup1;
998 } 998 }
999 buff = (unsigned char **) kmalloc(MAXSGENTRIES * 999 buff = kzalloc(MAXSGENTRIES * sizeof(char *), GFP_KERNEL);
1000 sizeof(char *), GFP_KERNEL);
1001 if (!buff) { 1000 if (!buff) {
1002 status = -ENOMEM; 1001 status = -ENOMEM;
1003 goto cleanup1; 1002 goto cleanup1;
1004 } 1003 }
1005 memset(buff, 0, MAXSGENTRIES);
1006 buff_size = (int *) kmalloc(MAXSGENTRIES * sizeof(int), 1004 buff_size = (int *) kmalloc(MAXSGENTRIES * sizeof(int),
1007 GFP_KERNEL); 1005 GFP_KERNEL);
1008 if (!buff_size) { 1006 if (!buff_size) {
@@ -2729,9 +2727,9 @@ static void __devinit cciss_interrupt_mode(ctlr_info_t *c, struct pci_dev *pdev,
2729 return; 2727 return;
2730 } 2728 }
2731 } 2729 }
2730default_int_mode:
2732#endif /* CONFIG_PCI_MSI */ 2731#endif /* CONFIG_PCI_MSI */
2733 /* if we get here we're going to use the default interrupt mode */ 2732 /* if we get here we're going to use the default interrupt mode */
2734default_int_mode:
2735 c->intr[SIMPLE_MODE_INT] = pdev->irq; 2733 c->intr[SIMPLE_MODE_INT] = pdev->irq;
2736 return; 2734 return;
2737} 2735}
@@ -2940,13 +2938,12 @@ static void cciss_getgeometry(int cntl_num)
2940 int block_size; 2938 int block_size;
2941 int total_size; 2939 int total_size;
2942 2940
2943 ld_buff = kmalloc(sizeof(ReportLunData_struct), GFP_KERNEL); 2941 ld_buff = kzalloc(sizeof(ReportLunData_struct), GFP_KERNEL);
2944 if (ld_buff == NULL) 2942 if (ld_buff == NULL)
2945 { 2943 {
2946 printk(KERN_ERR "cciss: out of memory\n"); 2944 printk(KERN_ERR "cciss: out of memory\n");
2947 return; 2945 return;
2948 } 2946 }
2949 memset(ld_buff, 0, sizeof(ReportLunData_struct));
2950 size_buff = kmalloc(sizeof( ReadCapdata_struct), GFP_KERNEL); 2947 size_buff = kmalloc(sizeof( ReadCapdata_struct), GFP_KERNEL);
2951 if (size_buff == NULL) 2948 if (size_buff == NULL)
2952 { 2949 {
@@ -3060,10 +3057,9 @@ static int alloc_cciss_hba(void)
3060 for(i=0; i< MAX_CTLR; i++) { 3057 for(i=0; i< MAX_CTLR; i++) {
3061 if (!hba[i]) { 3058 if (!hba[i]) {
3062 ctlr_info_t *p; 3059 ctlr_info_t *p;
3063 p = kmalloc(sizeof(ctlr_info_t), GFP_KERNEL); 3060 p = kzalloc(sizeof(ctlr_info_t), GFP_KERNEL);
3064 if (!p) 3061 if (!p)
3065 goto Enomem; 3062 goto Enomem;
3066 memset(p, 0, sizeof(ctlr_info_t));
3067 for (n = 0; n < NWD; n++) 3063 for (n = 0; n < NWD; n++)
3068 p->gendisk[n] = disk[n]; 3064 p->gendisk[n] = disk[n];
3069 hba[i] = p; 3065 hba[i] = p;