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:04:06 +0000 (14:04 -0700)
commitc4b35343a37b6c7b33025812667e0d97738bb008
tree700d2c7c3d48c5215230aab8c5d9393d9a869f55
parent5b0a0a5d8ccfd8b53e7c35b464170f5a938312a1
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