From 4a91c45ea57c4974c797b89dfed19e946a774787 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 14 Apr 2016 12:36:16 +0300 Subject: 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 Signed-off-by: Jacek Anaszewski --- drivers/leds/leds-tca6507.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/leds') 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], -- cgit v1.2.3