scsi: libcxgbi: fix NULL pointer dereference in cxgbi_device_destroy()
authorVarun Prakash <varun@chelsio.com>
Wed, 18 Dec 2019 13:45:31 +0000 (19:15 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 18:49:03 +0000 (19:49 +0100)
commit2921fd9b30a62ec3f8562900cba8ef18a10eeb48
treee9245b818edbade7f9b6532f317fa408ae816086
parentf44e6a300d45ca4ccb10af24974207bbce8bd607
scsi: libcxgbi: fix NULL pointer dereference in cxgbi_device_destroy()

[ Upstream commit 71482fde704efdd8c3abe0faf34d922c61e8d76b ]

If cxgb4i_ddp_init() fails then cdev->cdev2ppm will be NULL, so add a check
for NULL pointer before dereferencing it.

Link: https://lore.kernel.org/r/1576676731-3068-1-git-send-email-varun@chelsio.com
Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/cxgbi/libcxgbi.c