lkml.org 
[lkml]   [2010]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/6] Driver core: Fix potential memory leak
    On Thu, Jul 22, 2010 at 03:09:01PM -0700, Patrick Pannuto wrote:
    > In both of the 'goto out' cases, priv has already
    > been allocated and assigned to bus->p. We reset
    > bus->p to NULL, but neglect to free bus->p
    >
    > Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
    > ---
    > drivers/base/bus.c | 2 +-
    > 1 files changed, 1 insertions(+), 1 deletions(-)
    >
    > diff --git a/drivers/base/bus.c b/drivers/base/bus.c
    > index 12eec3f..eb1b7fa 100644
    > --- a/drivers/base/bus.c
    > +++ b/drivers/base/bus.c
    > @@ -945,8 +945,8 @@ bus_devices_fail:
    > bus_remove_file(bus, &bus_attr_uevent);
    > bus_uevent_fail:
    > kset_unregister(&bus->p->subsys);
    > - kfree(bus->p);
    > out:
    > + kfree(bus->p);

    This fix is already in my tree.

    thanks,

    greg k-h


    \
     
     \ /
      Last update: 2010-07-23 01:47    [W:4.678 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site