lkml.org 
[lkml]   [2019]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: EDAC: Fix memory leak in creating CSROW object
On Fri, Apr 19, 2019 at 08:35:36AM +0800, PanBian wrote:
> Yes, I see that. Because the loop start with (--i), there is no put
> operation for the device that fails to create. So, I think we cannot
> rule out the possibility of memory leak.

Ok, so this is not something you trigger - you're basically staring at
the code?

Well, there's something else questionable in that code which I asked
Greg about today but we didn't finish that conversation, let me CC him.

So AFAIU, devices for which device_add() has returned success,
should be removed with their counterpart device_del().
edac_create_csrow_objects(), however, does put_device() on those in the
"unwinding" loop.

And for the case where device_add() fails, you should do put_device() to
it. I.e., what you're saying.

So I think we need to figure what needs to be done when before fixing
this properly.

Greg?

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

\
 
 \ /
  Last update: 2019-04-19 02:46    [W:0.119 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site