linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qla2xxx: fix a potential NULL pointer dereference
@ 2019-09-18 16:36 Allen Pais
  2019-10-04  1:56 ` Martin K. Petersen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Allen Pais @ 2019-09-18 16:36 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, jejb, linux-kernel

alloc_workqueue is not checked for errors and as a result,
a potential NULL dereference could occur.

Signed-off-by: Allen Pais <allen.pais@oracle.com>
---
 drivers/scsi/qla2xxx/qla_os.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 98e60a3..31714c9 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3232,6 +3232,10 @@ static void qla2x00_iocb_work_fn(struct work_struct *work)
 	    req->req_q_in, req->req_q_out, rsp->rsp_q_in, rsp->rsp_q_out);
 
 	ha->wq = alloc_workqueue("qla2xxx_wq", 0, 0);
+	if (unlikely(!ha->wq)) {
+		ret = -ENOMEM;
+		goto probe_failed;
+	}
 
 	if (ha->isp_ops->initialize_adapter(base_vha)) {
 		ql_log(ql_log_fatal, base_vha, 0x00d6,
-- 
1.9.1


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

end of thread, other threads:[~2019-10-10  2:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 16:36 [PATCH] qla2xxx: fix a potential NULL pointer dereference Allen Pais
2019-10-04  1:56 ` Martin K. Petersen
2019-10-04  6:10 ` Martin Wilck
2019-10-10  2:29 ` Martin K. Petersen

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).