• Dan Carpenter's avatar
    drivers/leds/leds-lp5521.c: fix lp5521_read() error handling · 5bc9ad77
    Dan Carpenter authored
    Gcc 4.6.2 complains that:
    
      drivers/leds/leds-lp5521.c: In function `lp5521_load_program':
      drivers/leds/leds-lp5521.c:214:21: warning: `mode' may be used uninitialized in this function [-Wuninitialized]
      drivers/leds/leds-lp5521.c: In function `lp5521_probe':
      drivers/leds/leds-lp5521.c:788:5: warning: `buf' may be used uninitialized in this function [-Wuninitialized]
      drivers/leds/leds-lp5521.c:740:6: warning: `ret' may be used uninitialized in this function [-Wuninitialized]
    
    These are real problems if lp5521_read() returns an error.  When that
    happens we should handle it, instead of ignoring it or doing a bitwise
    OR with all the other error codes and continuing.
    Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
    Cc: Milo <Milo.Kim@ti.com>
    Cc: Richard Purdie <rpurdie@rpsys.net>
    Cc: Bryan Wu <bryan.wu@canonical.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    5bc9ad77
leds-lp5521.c 23 KB