diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2023-09-23 13:37:23 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-09-27 18:31:20 +0300 |
commit | b481f644d9174670b385c3a699617052cd2a79d3 (patch) | |
tree | e7e838dc51b792879151803266e39ef8082aff8b /fs/jfs/jfs_dmap.c | |
parent | 514f0c400bde6b62405467daaf2a0a86bcf7794b (diff) | |
download | linux-b481f644d9174670b385c3a699617052cd2a79d3.tar.xz |
scsi: zfcp: Fix a double put in zfcp_port_enqueue()
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: f3450c7b9172 ("[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>
Diffstat (limited to 'fs/jfs/jfs_dmap.c')
0 files changed, 0 insertions, 0 deletions