linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fusion-mptbase: handle failed allocation for workqueue
@ 2016-02-16  2:50 Insu Yun
  2016-02-16 18:18 ` Ewan Milne
  0 siblings, 1 reply; 4+ messages in thread
From: Insu Yun @ 2016-02-16  2:50 UTC (permalink / raw)
  To: nagalakshmi.nandigama, praveen.krishnamoorthy, sreekanth.reddy,
	abhijit.mahajan, MPT-FusionLinux.pdl, linux-scsi, linux-kernel
  Cc: taesoo, yeongjin.jang, insu, changwoo, Insu Yun

the failure of ioc->reset_work_q is checked,
but not ioc->fw_event_q.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
 drivers/message/fusion/mptbase.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 5dcc031..d4907a1 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1996,6 +1996,13 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
 	snprintf(ioc->fw_event_q_name, MPT_KOBJ_NAME_LEN, "mpt/%d", ioc->id);
 	ioc->fw_event_q = create_singlethread_workqueue(ioc->fw_event_q_name);
 
+	if (!ioc->fw_event_q) {
+		destroy_workqueue(ioc->reset_work_q);
+		pci_release_selected_regions(pdev, ioc->bars);
+		kfree(ioc);
+		return -ENOMEM;
+	}
+
 	if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
 	    CAN_SLEEP)) != 0){
 		printk(MYIOC_s_ERR_FMT "didn't initialize properly! (%d)\n",
-- 
1.9.1

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

end of thread, other threads:[~2016-02-17 16:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16  2:50 [PATCH] fusion-mptbase: handle failed allocation for workqueue Insu Yun
2016-02-16 18:18 ` Ewan Milne
     [not found]   ` <CAGoFzNfFtxHRYz_UF1qS-wWhwNapffBx9xrMA2Lu51FGeTmo7w@mail.gmail.com>
2016-02-16 20:52     ` Ewan Milne
2016-02-17 16:53       ` Tomas Henzl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).