scsi: bnx2i: fix potential use after free
authorPan Bian <bianpan2016@163.com>
Wed, 6 Nov 2019 12:32:21 +0000 (20:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:19:43 +0000 (08:19 +0100)
commit154d9c5b335282f2ee88d61890ae662e4b881005
tree3754004cacab27fcc40dffb0353be9a32c3ba2c3
parent2dd06d8b8ed64d197b37db91d40b843596d1c9cb
scsi: bnx2i: fix potential use after free

commit 29d28f2b8d3736ac61c28ef7e20fda63795b74d9 upstream.

The member hba->pcidev may be used after its reference is dropped. Move the
put function to where it is never used to avoid potential use after free
issues.

Fixes: a77171806515 ("[SCSI] bnx2i: Removed the reference to the netdev->base_addr")
Link: https://lore.kernel.org/r/1573043541-19126-1-git-send-email-bianpan2016@163.com
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/bnx2i/bnx2i_iscsi.c