public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] [SCSI] mpt2sas: add missing allocation.
@ 2011-11-04 18:25 Dan Carpenter
  2011-11-08  8:25 ` Nandigama, Nagalakshmi
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-11-04 18:25 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Kashyap Desai, James Bottomley, Nagalakshmi Nandigama, Eric Moore,
	linux-scsi, kernel-janitors

There was supposed to be a kzalloc() here and the compiler complained
about it.
mpt2sas_scsih.c: In function ‘mpt2sas_scsih_reset_handler’:
mpt2sas_scsih.c:2807:21: warning: ‘fw_event’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 8889b1b..4e041f6 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -2802,6 +2802,11 @@ _scsih_error_recovery_delete_devices(struct MPT2SAS_ADAPTER *ioc)
 
 	if (ioc->is_driver_loading)
 		return;
+
+	fw_event = kzalloc(sizeof(struct fw_event_work), GFP_ATOMIC);
+	if (!fw_event)
+		return;
+
 	fw_event->event = MPT2SAS_REMOVE_UNRESPONDING_DEVICES;
 	fw_event->ioc = ioc;
 	_scsih_fw_event_add(ioc, fw_event);
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [patch] [SCSI] mpt2sas: add missing allocation.
  2011-11-04 18:25 [patch] [SCSI] mpt2sas: add missing allocation Dan Carpenter
@ 2011-11-08  8:25 ` Nandigama, Nagalakshmi
  0 siblings, 0 replies; 2+ messages in thread
From: Nandigama, Nagalakshmi @ 2011-11-08  8:25 UTC (permalink / raw)
  To: Dan Carpenter, James E.J. Bottomley
  Cc: Desai, Kashyap, James Bottomley, Moore, Eric,
	linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org

The patch seem to be fine. Please consider this patch as an Acked by me

Regards,
Nagalakshmi


-----Original Message-----
From: Dan Carpenter [mailto:dan.carpenter@oracle.com] 
Sent: Friday, November 04, 2011 11:55 PM
To: James E.J. Bottomley
Cc: Desai, Kashyap; James Bottomley; Nandigama, Nagalakshmi; Moore, Eric; linux-scsi@vger.kernel.org; kernel-janitors@vger.kernel.org
Subject: [patch] [SCSI] mpt2sas: add missing allocation.

There was supposed to be a kzalloc() here and the compiler complained
about it.
mpt2sas_scsih.c: In function ‘mpt2sas_scsih_reset_handler’:
mpt2sas_scsih.c:2807:21: warning: ‘fw_event’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 8889b1b..4e041f6 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -2802,6 +2802,11 @@ _scsih_error_recovery_delete_devices(struct MPT2SAS_ADAPTER *ioc)
 
 	if (ioc->is_driver_loading)
 		return;
+
+	fw_event = kzalloc(sizeof(struct fw_event_work), GFP_ATOMIC);
+	if (!fw_event)
+		return;
+
 	fw_event->event = MPT2SAS_REMOVE_UNRESPONDING_DEVICES;
 	fw_event->ioc = ioc;
 	_scsih_fw_event_add(ioc, fw_event);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-08  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-04 18:25 [patch] [SCSI] mpt2sas: add missing allocation Dan Carpenter
2011-11-08  8:25 ` Nandigama, Nagalakshmi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox