[openib-general] Re: [PATCH] mad.c memory leak
Sean Hefty
mshefty at ichips.intel.com
Wed Mar 15 14:52:55 PST 2006
Roland Dreier wrote:
> > --- user_mad.c (revision 5693)
> > +++ user_mad.c (working copy)
> > @@ -701,8 +701,11 @@ static int ib_umad_close(struct inode *i
> > already_dead = file->agents_dead;
> > file->agents_dead = 1;
> >
> > - list_for_each_entry_safe(packet, tmp, &file->recv_list, list)
> > + list_for_each_entry_safe(packet, tmp, &file->recv_list, list) {
> > + if (packet->recv_wc)
> > + ib_free_recv_mad(packet->recv_wc);
> > kfree(packet);
> > + }
> >
> > list_del(&file->port_list);
>
> Yes, this definitely looks like it is needed.
I ran some brief tests, and didn't see any issues, so I committed this.
- Sean
More information about the general
mailing list