1. 12 10月, 2007 2 次提交
    • J
      backlight: Fix cr_bllcd allocations and error paths · 0b75f2df
      Jesper Juhl 提交于
      After fixing the too small memory allocation in cr_backlight_probe()
      from drivers/video/backlight/cr_bllcd.c
      (commit e3bbb3f0) I noticed that the
      Coverity checker also thought there were a few memory leaks in there.
      I took a closer look and confirmed that there were indeed several
      leaks.
      
      At the start of the function we allocate storage for a
      'struct cr_panel' and store the pointer in a variable named 'crp'.
      
      Then we call pci_get_device() and pci_read_config_byte() and if
      either of them fail we return without freeing the memory allocated
      for the 'struct cr_panel'. These two leaks are easy to fix since we
      don't even use 'crp' for anything up to this point, so I simply
      moved the allocation further down in the function so it only happens
      just before we actually need it.
      
      A bit further down we call backlight_device_register() and store the
      result in 'crp->cr_backlight_device'. In case of error we return
      'crp->cr_backlight_device' from the function, thus leaking 'crp'
      itself. The same thing happens with the call to lcd_device_register().
      To fix these two leaks I declare two new pointers to hold the return
      values, so that in case of error we can return the pointer (as before)
      but without leaking 'crp'.
      
      This version of the patch also adds missing
      backlight_device_unregister() / lcd_device_unregister() / pci_dev_put()
      calls to error paths.
        Thanks to Richard Purdie <rpurdie@rpsys.net> for noticing.
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NRichard Purdie <rpurdie@rpsys.net>
      0b75f2df
    • A
      backlight/leds: Make two structs static · 0ad90efd
      Adrian Bunk 提交于
      This patch makes two needlessly global structs static.
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NRichard Purdie <rpurdie@rpsys.net>
      0ad90efd
  2. 20 9月, 2007 1 次提交
  3. 13 9月, 2007 2 次提交
  4. 12 9月, 2007 1 次提交
  5. 31 8月, 2007 1 次提交
  6. 27 8月, 2007 3 次提交
  7. 23 8月, 2007 3 次提交
  8. 12 8月, 2007 6 次提交
  9. 04 8月, 2007 1 次提交
  10. 01 8月, 2007 8 次提交
  11. 30 7月, 2007 2 次提交
    • D
      [SPARC]: Mark SBUS framebuffer ioctls as IGNORE in compat_ioctl.c · 8163904e
      David S. Miller 提交于
      They are handled in a ->compat_ioctl() handler, so it's just noise
      when compat_ioctl.c warns which occurs when they are used on non-SBUS
      framebuffer devices.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8163904e
    • D
      [VIDEO]: Fix OOPS in all SBUS framebuffer drivers. · c7f439b9
      David S. Miller 提交于
      All of these drivers use a silly:
      
      struct all_info {
      	struct fb_info info;
      	struct foo_par par;
      };
      
      struct all_info *all = kzalloc(sizeof(*all), GFP_KERNEL);
      all->info.par = &all->par;
      
      etc. etc. code sequence, basically replicating the provided
      framebuffer_alloc()/framebuffer_release(), and doing it badly.
      
      Not only is this massive code duplication, it also caused a
      bug in that we weren't setting the fb_info->device pointer
      which results in an OOPS when fb_is_primary_device() runs.
      
      Fix all of this by using framebuffer_{alloc,release}() and
      passing in "&of_device->dev" as the device pointer.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c7f439b9
  12. 27 7月, 2007 2 次提交
  13. 25 7月, 2007 1 次提交
  14. 22 7月, 2007 7 次提交