linux/drivers/scsi/elx
Dan Carpenter baeb8628ab scsi: elx: libefc: Fix potential use after free in efc_nport_vport_del()
[ Upstream commit 2e4b02fad0 ]

The kref_put() function will call nport->release if the refcount drops to
zero.  The nport->release release function is _efc_nport_free() which frees
"nport".  But then we dereference "nport" on the next line which is a use
after free.  Re-order these lines to avoid the use after free.

Fixes: fcd427303e ("scsi: elx: libefc: SLI and FC PORT state machine interfaces")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/b666ab26-6581-4213-9a3d-32a9147f0399@stanley.mountain
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-10-04 16:29:10 +02:00
..
efct Merge patch series "Constify most SCSI host templates" 2023-03-24 20:13:03 -04:00
include scsi: elx: libefc_sli: Queue create/destroy/parse routines 2021-06-15 23:39:29 -04:00
libefc scsi: elx: libefc: Fix potential use after free in efc_nport_vport_del() 2024-10-04 16:29:10 +02:00
libefc_sli scsi: elx: sli4: Remove code duplication 2023-08-21 17:13:56 -04:00
Kconfig scsi: elx: efct: Add Makefile and Kconfig for efct driver 2021-06-15 23:39:33 -04:00
Makefile scsi: elx: efct: Add Makefile and Kconfig for efct driver 2021-06-15 23:39:33 -04:00