Skip to content
Commit b3236a64 authored by Jianglei Nie's avatar Jianglei Nie Committed by Leon Romanovsky
Browse files

RDMA/qedr: Fix potential memory leak in __qedr_alloc_mr()

__qedr_alloc_mr() allocates a memory chunk for "mr->info.pbl_table" with
init_mr_info(). When rdma_alloc_tid() and rdma_register_tid() fail, "mr"
is released while "mr->info.pbl_table" is not released, which will lead
to a memory leak.

We should release the "mr->info.pbl_table" with qedr_free_pbl() when error
occurs to fix the memory leak.

Fixes: e0290cce ("qedr: Add support for memory registeration verbs")
Link: https://lore.kernel.org/r/20220714061505.2342759-1-niejianglei2021@163.com


Signed-off-by: default avatarJianglei Nie <niejianglei2021@163.com>
Acked-by: default avatarMichal <Kalderon &lt;michal.kalderon@marvell.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent e39c6000
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment