scsi: bnx2fc: Fix error handling in probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 24 Jan 2019 10:29:40 +0000 (13:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:02:30 +0000 (14:02 -0700)
commit59411d98fb10c6897f9170bd17ad4e34d01209b9
tree62bb4825b7c938183b2ef03ec040fdf6d2ad6ec7
parent8d27f830b6159c687e704e98a96133e746a9ed22
scsi: bnx2fc: Fix error handling in probe()

[ Upstream commit b2d3492fc591b1fb46b81d79ca1fc44cac6ae0ae ]

There are two issues here.  First if cmgr->hba is not set early enough then
it leads to a NULL dereference.  Second if we don't completely initialize
cmgr->io_bdt_pool[] then we end up dereferencing uninitialized pointers.

Fixes: 853e2bd2103a ("[SCSI] bnx2fc: Broadcom FCoE offload driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/bnx2fc/bnx2fc_io.c