* [patch] leds: tca6507: silence an uninitialized variable warning
@ 2016-04-14 9:36 Dan Carpenter
2016-04-14 11:12 ` Jacek Anaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-04-14 9:36 UTC (permalink / raw)
To: Richard Purdie
Cc: Jacek Anaszewski, linux-leds, linux-kernel, kernel-janitors
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>
diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index c548ea1..45222a7 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],
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] leds: tca6507: silence an uninitialized variable warning
2016-04-14 9:36 [patch] leds: tca6507: silence an uninitialized variable warning Dan Carpenter
@ 2016-04-14 11:12 ` Jacek Anaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Jacek Anaszewski @ 2016-04-14 11:12 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Richard Purdie, linux-leds, linux-kernel, kernel-janitors
Hi Dan,
Thanks for the patch.
Applied to the for-next branch of linux-leds.git.
Thanks,
Jacek Anaszewski
On 04/14/2016 11:36 AM, Dan Carpenter wrote:
> 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>
>
> diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
> index c548ea1..45222a7 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],
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-14 11:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-14 9:36 [patch] leds: tca6507: silence an uninitialized variable warning Dan Carpenter
2016-04-14 11:12 ` Jacek Anaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).