FreeBSD Bugzilla – Attachment 234011 Details for
Bug 264057
ofed/drivers/infiniband: mad: Fix a possible memory leak
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
a possible patch
0001-mad-Fix-a-possible-memory-leak.patch (text/plain), 1022 bytes, created by
ruc_gongyuanjun
on 2022-05-18 03:28:36 UTC
(
hide
)
Description:
a possible patch
Filename:
MIME Type:
Creator:
ruc_gongyuanjun
Created:
2022-05-18 03:28:36 UTC
Size:
1022 bytes
patch
obsolete
>From 5bb7c3f665431286754edf18e563983df7dff63a Mon Sep 17 00:00:00 2001 >From: Yuanjun Gong <ruc_gongyuanjun@163.com> >Date: Wed, 18 May 2022 11:21:21 +0800 >Subject: [PATCH 1/1] mad: Fix a possible memory leak > >If ib_dma_mapping_error, it will jump out of the loop, leaving >mad_priv allocated by alloc_mad_private not freed. It will cause >a memory leak. Fix it with kfree. > >Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> >--- > sys/ofed/drivers/infiniband/core/ib_mad.c | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/sys/ofed/drivers/infiniband/core/ib_mad.c b/sys/ofed/drivers/infiniband/core/ib_mad.c >index 5f9c353052e8..9de97d749f6d 100644 >--- a/sys/ofed/drivers/infiniband/core/ib_mad.c >+++ b/sys/ofed/drivers/infiniband/core/ib_mad.c >@@ -2874,6 +2874,7 @@ static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info, > DMA_FROM_DEVICE); > if (unlikely(ib_dma_mapping_error(qp_info->port_priv->device, > sg_list.addr))) { >+ kfree(mad_priv); > ret = -ENOMEM; > break; > } >-- >2.17.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 264057
: 234011