From: Guenter Roeck Date: Thu, 26 Apr 2012 12:10:33 +0000 (-0700) Subject: Check for invalid temperature source X-Git-Tag: nct6775-v0.9~31 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=34960d4d6e9c0cc22cd12f5a6d8dcbb5ebf975f0;p=groeck-nct6775 Check for invalid temperature source Signed-off-by: Guenter Roeck --- diff --git a/nct6775.c b/nct6775.c index 9a5d955..6e21ffb 100644 --- a/nct6775.c +++ b/nct6775.c @@ -3330,6 +3330,12 @@ static int __devinit nct6775_probe(struct platform_device *pdev) if (!src || (mask & (1 << src))) continue; + if (src >= data->temp_label_num || + !strlen(data->temp_label[src])) { + dev_info(dev, "Invalid temperature source %d\n", src); + continue; + } + mask |= 1 << src; /* Use fixed index for SYSTIN(1), CPUTIN(2), AUXTIN(3) */