linux-stable/drivers/s390
Dinghao Liu 44d3ee21d8 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 21:43:40 +02:00
..
block s390/dasd: use correct number of retries for ERP requests 2023-09-23 10:46:53 +02:00
char s390/zcore: fix race when reading from hardware system area 2022-08-25 11:11:25 +02:00
cio s390/cio: unregister device when the only path is gone 2023-06-28 10:14:21 +02:00
crypto s390/zcrypt: handle new reply code FILTERED_BY_HYPERVISOR 2020-01-04 13:59:54 +01:00
net s390/lcs: Fix return type of lcs_start_xmit() 2023-01-18 09:26:31 +01:00
scsi scsi: zfcp: Fix a double put in zfcp_port_enqueue() 2023-10-10 21:43:40 +02:00
virtio virtio/s390: implement virtio-ccw revision 2 correctly 2021-03-07 11:27:42 +01:00
Makefile