]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Wed, 27 Dec 2023 07:02:27 +0000 (15:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Jan 2024 17:51:18 +0000 (18:51 +0100)
commitbc56ed720e064f4ea3908b3fbcd63d94ab98e994
tree2930e32ebb67e9489da0f60e9485331635b67933
parentcfcf5490145a13ac2dbf18596812ef63b2aeb93e
net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues

[ Upstream commit 89f45c30172c80e55c887f32f1af8e184124577b ]

When dma_alloc_coherent() fails, we should free qdev->lrg_buf
to prevent potential memleak.

Fixes: 1357bfcf7106 ("qla3xxx: Dynamically size the rx buffer queue based on the MTU.")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20231227070227.10527-1-dinghao.liu@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/qlogic/qla3xxx.c