]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
hwmon: End of I/O region off-by-one
authorJean Delvare <khali@linux-fr.org>
Thu, 20 Sep 2007 12:13:14 +0000 (14:13 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 26 Sep 2007 17:54:39 +0000 (10:54 -0700)
Fix an off-by-one error in the I/O region declaration of two
hardware monitoring drivers (lm78 and w83781d.) We were requesting
one extra port at the end of the region.

This is a regression in 2.6.22 and could prevent other drivers from
loading properly.

Already applied to Linus' tree for 2.6.23:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=15bde2f1a8e819213f54314505a5a0509673109b

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hwmon/lm78.c
drivers/hwmon/w83781d.c

index 9fb572f03ba5bf707cd8768a7c1f60928c444821..3507113759e415c65642c6087b5a73e8809c078b 100644 (file)
@@ -882,7 +882,7 @@ static int __init lm78_isa_device_add(unsigned short address)
 {
        struct resource res = {
                .start  = address,
-               .end    = address + LM78_EXTENT,
+               .end    = address + LM78_EXTENT - 1,
                .name   = "lm78",
                .flags  = IORESOURCE_IO,
        };
index c95909cc1d219ab35b0e2c2484a9202220dc341b..dcc941a5aaff6e06d286868b52b50f98126ffb84 100644 (file)
@@ -1746,7 +1746,7 @@ w83781d_isa_device_add(unsigned short address)
 {
        struct resource res = {
                .start  = address,
-               .end    = address + W83781D_EXTENT,
+               .end    = address + W83781D_EXTENT - 1,
                .name   = "w83781d",
                .flags  = IORESOURCE_IO,
        };