diff options
Diffstat (limited to 'drivers/scsi/3w-9xxx.c')
-rw-r--r-- | drivers/scsi/3w-9xxx.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index fcad9fd73971..efd9d8d3a890 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c | |||
@@ -1163,13 +1163,12 @@ static int twa_initialize_device_extension(TW_Device_Extension *tw_dev) | |||
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | /* Allocate event info space */ | 1165 | /* Allocate event info space */ |
1166 | tw_dev->event_queue[0] = kmalloc(sizeof(TW_Event) * TW_Q_LENGTH, GFP_KERNEL); | 1166 | tw_dev->event_queue[0] = kcalloc(TW_Q_LENGTH, sizeof(TW_Event), GFP_KERNEL); |
1167 | if (!tw_dev->event_queue[0]) { | 1167 | if (!tw_dev->event_queue[0]) { |
1168 | TW_PRINTK(tw_dev->host, TW_DRIVER, 0x18, "Event info memory allocation failed"); | 1168 | TW_PRINTK(tw_dev->host, TW_DRIVER, 0x18, "Event info memory allocation failed"); |
1169 | goto out; | 1169 | goto out; |
1170 | } | 1170 | } |
1171 | 1171 | ||
1172 | memset(tw_dev->event_queue[0], 0, sizeof(TW_Event) * TW_Q_LENGTH); | ||
1173 | 1172 | ||
1174 | for (i = 0; i < TW_Q_LENGTH; i++) { | 1173 | for (i = 0; i < TW_Q_LENGTH; i++) { |
1175 | tw_dev->event_queue[i] = (TW_Event *)((unsigned char *)tw_dev->event_queue[0] + (i * sizeof(TW_Event))); | 1174 | tw_dev->event_queue[i] = (TW_Event *)((unsigned char *)tw_dev->event_queue[0] + (i * sizeof(TW_Event))); |