linux/drivers/scsi/elx
Dan Carpenter 16a570f07d 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>
2024-10-17 15:10:52 +02:00
..
efct
include
libefc scsi: elx: libefc: Fix potential use after free in efc_nport_vport_del() 2024-10-17 15:10:52 +02:00
libefc_sli
Kconfig
Makefile