From: Roland Dreier <roland@topspin.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: [PATCH 1/2] IB: fix potential ib_umad leak
Date: Tue, 24 May 2005 15:20:57 -0700 [thread overview]
Message-ID: <20055241520.C8dwwpEn6S7vuoR1@topspin.com> (raw)
In-Reply-To: <20055241520.Hsf2RosQGYxIWuXH@topspin.com>
Free all unclaimed MAD receive buffers when userspace closes our file
so we don't leak memory.
Signed-off-by: Roland Dreier <roland@topspin.com>
---
drivers/infiniband/core/user_mad.c | 4 ++++
1 files changed, 4 insertions(+)
--- linux-git.orig/drivers/infiniband/core/user_mad.c 2005-05-24 15:11:25.795151912 -0700
+++ linux-git/drivers/infiniband/core/user_mad.c 2005-05-24 15:17:39.800453121 -0700
@@ -499,6 +499,7 @@
static int ib_umad_close(struct inode *inode, struct file *filp)
{
struct ib_umad_file *file = filp->private_data;
+ struct ib_umad_packet *packet, *tmp;
int i;
for (i = 0; i < IB_UMAD_MAX_AGENTS; ++i)
@@ -507,6 +508,9 @@
ib_unregister_mad_agent(file->agent[i]);
}
+ list_for_each_entry_safe(packet, tmp, &file->recv_list, list)
+ kfree(packet);
+
kfree(file);
return 0;
next prev parent reply other threads:[~2005-05-24 22:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-24 22:20 [PATCH 0/2] IB: allow NULL sa_query callbacks Roland Dreier
2005-05-24 22:20 ` Roland Dreier [this message]
2005-05-24 22:20 ` [PATCH 2/2] IB: fix endianness of path record MTU field Roland Dreier
2005-05-24 22:23 ` [openib-general] [PATCH 0/2] IB: allow NULL sa_query callbacks Roland Dreier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20055241520.C8dwwpEn6S7vuoR1@topspin.com \
--to=roland@topspin.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openib-general@openib.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®