scsi: qla2xxx: Check return value of alloc_workqueue()
Subsystems (2)
PATCH 1/1 scsi: qla2xxx: Check return value of alloc_workqueue()
Do not derefence the pointer without checking it first. alloc_workqueue() can return a NULL pointer.
Cc Himanshu Madhani <[email protected]>
Signed-off-by Daniel Wagner <[email protected]>
--- drivers/scsi/qla2xxx/qla_os.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/qla2xxx/qla_os.c +4 -0
@@ -3224,6 +3224,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) 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 (!ha->wq) { + ret = -ENOMEM ; + goto probe_failed; + }if (ha->isp_ops->initialize_adapter (base_vha)) { ql_log(ql_log_fatal, base_vha, 0x00d6,
Signature · 1 line
2.16.4
Quoted 2 lines · Daniel Wagner
Do not derefence the pointer without checking it first.
alloc_workqueue()can return a NULL pointer.
Oh forget it. Someone was faster :)