]> git.sur5r.net Git - groeck-nct6775/commitdiff
Check for invalid temperature source
authorGuenter Roeck <linux@roeck-us.net>
Thu, 26 Apr 2012 12:10:33 +0000 (05:10 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 26 Apr 2012 12:13:33 +0000 (05:13 -0700)
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
nct6775.c

index 9a5d95599db3706799cd405825e54c641aa8bccc..6e21ffbd34d5372538d07acbde5971b84fa572cd 100644 (file)
--- 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) */