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 76c09097175f..6b49f6a2524d 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c | |||
@@ -1160,13 +1160,12 @@ static int twa_initialize_device_extension(TW_Device_Extension *tw_dev) | |||
1160 | } | 1160 | } |
1161 | 1161 | ||
1162 | /* Allocate event info space */ | 1162 | /* Allocate event info space */ |
1163 | tw_dev->event_queue[0] = kmalloc(sizeof(TW_Event) * TW_Q_LENGTH, GFP_KERNEL); | 1163 | tw_dev->event_queue[0] = kcalloc(TW_Q_LENGTH, sizeof(TW_Event), GFP_KERNEL); |
1164 | if (!tw_dev->event_queue[0]) { | 1164 | if (!tw_dev->event_queue[0]) { |
1165 | TW_PRINTK(tw_dev->host, TW_DRIVER, 0x18, "Event info memory allocation failed"); | 1165 | TW_PRINTK(tw_dev->host, TW_DRIVER, 0x18, "Event info memory allocation failed"); |
1166 | goto out; | 1166 | goto out; |
1167 | } | 1167 | } |
1168 | 1168 | ||
1169 | memset(tw_dev->event_queue[0], 0, sizeof(TW_Event) * TW_Q_LENGTH); | ||
1170 | 1169 | ||
1171 | for (i = 0; i < TW_Q_LENGTH; i++) { | 1170 | for (i = 0; i < TW_Q_LENGTH; i++) { |
1172 | tw_dev->event_queue[i] = (TW_Event *)((unsigned char *)tw_dev->event_queue[0] + (i * sizeof(TW_Event))); | 1171 | tw_dev->event_queue[i] = (TW_Event *)((unsigned char *)tw_dev->event_queue[0] + (i * sizeof(TW_Event))); |