Files
linux/drivers
Jesper Juhl b91aac29bb PCI Hotplug: Fix small mem leak in IBM Hot Plug Controller Driver
In drivers/pci/hotplug/ibmphp_ebda.c::ebda_rsrc_controller(), storage is
allocated with kzalloc() and assigned to 'tmp_slot'.  Then lots of
stuff, like ->flag, ->supported_speed etc is set in tmp_slot.  A bit
further down there's then this test :

  if (!bus_info_ptr1) {
    rc = -ENODEV;
    goto error;
  }

At this point, tmp_slot has not been assigned to anything, so when
erroring-out we want to free it, but nothing at the 'error:' label
free's 'tmp_slot' - and we can't really free 'tmp_slot' at 'error:'
since we may jump to that label later when 'tmp_slot' *has* been used
and we do not want it freed. So, the only sane option left seems to be
to kfree(tmp_slot) just before jumping to the 'error:' label in the one
place where this is what actually makes sense. The following patch does
just that and thus kills off a tiny potential memory leak.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-03-10 16:38:02 -07:00
..
…
2008-03-05 07:53:06 -05:00
…
2008-03-04 16:35:12 -08:00
…
…
…
…
…
2008-02-24 20:03:42 +01:00
…
…
…
2008-03-04 11:03:09 +02:00
…
2008-02-13 16:21:19 -08:00
2008-03-03 10:47:13 -08:00
…
2008-02-26 14:12:09 +09:00
…
…
2008-02-21 15:27:07 -08:00
2008-03-04 16:35:12 -08:00
…
…
…