scsi: qla2xxx: fix a potential NULL pointer dereference

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

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Allen Pais <[email protected]>
Reviewed-by: Martin Wilck <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
Allen Pais 2019-09-18 22:06:58 +05:30 • committed by Martin K. Petersen
commit 35a79a6351

View file

@ -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 (unlikely(!ha->wq)) {
ret = -ENOMEM;
goto probe_failed;
}
if (ha->isp_ops->initialize_adapter(base_vha)) {
ql_log(ql_log_fatal, base_vha, 0x00d6,