]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/core: Fix memory leak in __ib_create_cq() on invalid cqe
authorChenguang Zhao <zhaochenguang@kylinos.cn>
Thu, 25 Jun 2026 02:01:48 +0000 (10:01 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 2 Jul 2026 17:19:33 +0000 (14:19 -0300)
commite939334ea7dd219f100f963dbb1cb43df520c20a
tree830d35b85de39b67e3bc53b5cdf18c12a4576fd8
parent155fd5ce2382b0ffbec0d7ee7b3a6818a27a5aed
RDMA/core: Fix memory leak in __ib_create_cq() on invalid cqe

Move the zero CQE validation before rdma_zalloc_drv_obj() to avoid
leaking the CQ object when returning -EINVAL.

Fixes: a2917582887a ("RDMA/core: Reject zero CQE count")
Link: https://patch.msgid.link/r/20260625020148.224537-1-zhaochenguang@kylinos.cn
Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/verbs.c