Private
Public Access
2
0

mraa.c: mraa_pin_mode_test should check against b->gpio_count -1

It's already the case for rpi & MMAX but it should be noted that on 1 indexed
boards gpio_count should be +1

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-12-18 14:20:14 +00:00
parent 1ee5e25f85
commit 2574efdb1d

View File

@@ -228,7 +228,7 @@ mraa_pin_mode_test(int pin, mraa_pinmodes_t mode)
if (plat == NULL)
return 0;
}
if (pin > plat->phy_pin_count || pin < 0)
if (pin > (plat->phy_pin_count -1) || pin < 0)
return 0;
switch(mode) {