1. 11 Mar, 2008 38 commits
  2. 10 Mar, 2008 2 commits
    • Jesper Juhl's avatar
      PCI Hotplug: Fix small mem leak in IBM Hot Plug Controller Driver · b91aac29
      Jesper Juhl authored
      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: default avatarJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b91aac29
    • Andrew Morton's avatar
      PCI: rename DECLARE_PCI_DEVICE_TABLE to DEFINE_PCI_DEVICE_TABLE · 8647af71
      Andrew Morton authored
      a) DECLARE_PCI_DEVICE_TABLE is misnamed.  It is used to *define* tables,
         not to declare them.  It should be called DEFINE_PCI_DEVICE_TABLE.
      
      b) It's lame, anyway.  We could implement any number of such helper
         thingies, but we choose not to.
      
      
      So I wouldn't go adding code which uses this thing until it has a correct
      name, and until we've decided that we actually want to live with it.
      
      
      From: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jonas Bonn <jonas@southpole.se>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8647af71