summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-04-14 11:36:16 +0200
committerJacek Anaszewski <j.anaszewski@samsung.com>2016-04-14 13:08:58 +0200
commit4a91c45ea57c4974c797b89dfed19e946a774787 (patch)
tree37863107e8c55cda5c4b9ef44bc994fefb9aae58 /drivers
parentmtd: Hook I/O activity to the MTD LED trigger (diff)
downloadlinux-4a91c45ea57c4974c797b89dfed19e946a774787.tar.xz
linux-4a91c45ea57c4974c797b89dfed19e946a774787.zip
leds: tca6507: silence an uninitialized variable warning
If choose_times() returns -EINVAL that means "c1" and "c2" haven't been initialized. I've added a check for that. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/leds/leds-tca6507.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index c548ea10f0f0..45222a7f4f75 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -327,6 +327,8 @@ static void set_times(struct tca6507_chip *tca, int bank)
int result;
result = choose_times(tca->bank[bank].ontime, &c1, &c2);
+ if (result < 0)
+ return;
dev_dbg(&tca->client->dev,
"Chose on times %d(%d) %d(%d) for %dms\n",
c1, time_codes[c1],