linux-stable/drivers/s390/scsi
Dinghao Liu cdf18e7585 scsi: zfcp: Fix a double put in zfcp_port_enqueue()
commit b481f644d9 upstream.

When device_register() fails, zfcp_port_release() will be called after
put_device(). As a result, zfcp_ccw_adapter_put() will be called twice: one
in zfcp_port_release() and one in the error path after device_register().
So the reference on the adapter object is doubly put, which may lead to a
premature free. Fix this by adjusting the error tag after
device_register().

Fixes: f3450c7b91 ("[SCSI] zfcp: Replace local reference counting with common kref")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20230923103723.10320-1-dinghao.liu@zju.edu.cn
Acked-by: Benjamin Block <bblock@linux.ibm.com>
Cc: stable@vger.kernel.org # v2.6.33+
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-10 22:00:38 +02:00
..
Makefile
zfcp_aux.c
zfcp_ccw.c
zfcp_dbf.c
zfcp_dbf.h
zfcp_def.h
zfcp_diag.c
zfcp_diag.h
zfcp_erp.c
zfcp_ext.h
zfcp_fc.c
zfcp_fc.h
zfcp_fsf.c
zfcp_fsf.h
zfcp_qdio.c
zfcp_qdio.h
zfcp_reqlist.h
zfcp_scsi.c
zfcp_sysfs.c
zfcp_unit.c