Private
Public Access
2
0

mraa.c: Fix pin mode test to check for NULL platform

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-03-11 11:35:31 +00:00
parent 2919b38b15
commit f07a442860

View File

@@ -497,7 +497,7 @@ mraa_pin_mode_test(int pin, mraa_pinmodes_t mode)
pin = mraa_get_sub_platform_index(pin); pin = mraa_get_sub_platform_index(pin);
} }
if (current_plat == NULL || current_plat->platform_type == MRAA_UNKNOWN_PLATFORM) { if (current_plat == NULL || current_plat->platform_type == MRAA_UNKNOWN_PLATFORM || current_plat->platform_type == MRAA_NULL_PLATFORM) {
return 0; return 0;
} }
if (pin > (current_plat->phy_pin_count - 1) || pin < 0) if (pin > (current_plat->phy_pin_count - 1) || pin < 0)