aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptsas.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r--drivers/message/fusion/mptsas.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index a0d4218103db..b0b74c4d2645 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -990,11 +990,10 @@ mptsas_queue_device_delete(MPT_ADAPTER *ioc,
990 MpiEventDataSasDeviceStatusChange_t *sas_event_data) 990 MpiEventDataSasDeviceStatusChange_t *sas_event_data)
991{ 991{
992 struct fw_event_work *fw_event; 992 struct fw_event_work *fw_event;
993 int sz;
994 993
995 sz = offsetof(struct fw_event_work, event_data) + 994 fw_event = kzalloc(sizeof(*fw_event) +
996 sizeof(MpiEventDataSasDeviceStatusChange_t); 995 sizeof(MpiEventDataSasDeviceStatusChange_t),
997 fw_event = kzalloc(sz, GFP_ATOMIC); 996 GFP_ATOMIC);
998 if (!fw_event) { 997 if (!fw_event) {
999 printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", 998 printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n",
1000 ioc->name, __func__, __LINE__); 999 ioc->name, __func__, __LINE__);
@@ -1011,10 +1010,8 @@ static void
1011mptsas_queue_rescan(MPT_ADAPTER *ioc) 1010mptsas_queue_rescan(MPT_ADAPTER *ioc)
1012{ 1011{
1013 struct fw_event_work *fw_event; 1012 struct fw_event_work *fw_event;
1014 int sz;
1015 1013
1016 sz = offsetof(struct fw_event_work, event_data); 1014 fw_event = kzalloc(sizeof(*fw_event), GFP_ATOMIC);
1017 fw_event = kzalloc(sz, GFP_ATOMIC);
1018 if (!fw_event) { 1015 if (!fw_event) {
1019 printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", 1016 printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n",
1020 ioc->name, __func__, __LINE__); 1017 ioc->name, __func__, __LINE__);
@@ -4983,7 +4980,7 @@ static int
4983mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply) 4980mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply)
4984{ 4981{
4985 u32 event = le32_to_cpu(reply->Event); 4982 u32 event = le32_to_cpu(reply->Event);
4986 int sz, event_data_sz; 4983 int event_data_sz;
4987 struct fw_event_work *fw_event; 4984 struct fw_event_work *fw_event;
4988 unsigned long delay; 4985 unsigned long delay;
4989 4986
@@ -5093,8 +5090,7 @@ mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply)
5093 5090
5094 event_data_sz = ((reply->MsgLength * 4) - 5091 event_data_sz = ((reply->MsgLength * 4) -
5095 offsetof(EventNotificationReply_t, Data)); 5092 offsetof(EventNotificationReply_t, Data));
5096 sz = offsetof(struct fw_event_work, event_data) + event_data_sz; 5093 fw_event = kzalloc(sizeof(*fw_event) + event_data_sz, GFP_ATOMIC);
5097 fw_event = kzalloc(sz, GFP_ATOMIC);
5098 if (!fw_event) { 5094 if (!fw_event) {
5099 printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", ioc->name, 5095 printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", ioc->name,
5100 __func__, __LINE__); 5096 __func__, __LINE__);