1. 11 Mar, 2008 37 commits
  2. 10 Mar, 2008 3 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
    • James Bottomley's avatar
      drivers: fix dma_get_required_mask · e88a0c2c
      James Bottomley authored
      There's a bug in the current implementation of dma_get_required_mask()
      where it ands the returned mask with the current device mask.  This
      rather defeats the purpose if you're using the call to determine what
      your mask should be (since you will at that time have the default
      DMA_32BIT_MASK).  This bug results in any driver that uses this function
      *always* getting a 32 bit mask, which is wrong.
      
      Fix by removing the and with dev->dma_mask.
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      e88a0c2c