]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: qedi: Fix a possible memory leak in qedi_alloc_and_init_sb()
authorZhen Lei <thunder.leizhen@huawei.com>
Sat, 26 Oct 2024 12:57:11 +0000 (20:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:02 +0000 (19:51 +0100)
commitbb8b45883eb072adba297922b67d1467082ac880
tree1e1486a8b6e608cc8630ae287773cc22c89c5839
parent64654bf5efb3f748e6fc41227adda689618ce9c4
scsi: qedi: Fix a possible memory leak in qedi_alloc_and_init_sb()

[ Upstream commit 95bbdca4999bc59a72ebab01663d421d6ce5775d ]

Hook "qedi_ops->common->sb_init = qed_sb_init" does not release the DMA
memory sb_virt when it fails. Add dma_free_coherent() to free it. This
is the same way as qedr_alloc_mem_sb() and qede_alloc_mem_sb().

Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.")
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20241026125711.484-3-thunder.leizhen@huawei.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/qedi/qedi_main.c