Private
Public Access
2
0

mraa: with NULL platform board max counts need to be checked to >= not just >

This fixes bugs when USBPLAT or FIRMATA is enabled when a NULL platform is
added or even a platform without ADC

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-02-18 17:22:22 +00:00
parent 78caa990f1
commit 4b76fbd14c
2 changed files with 2 additions and 2 deletions

View File

@@ -107,7 +107,7 @@ mraa_aio_init(unsigned int aio)
syslog(LOG_ERR, "aio: pin %i beyond platform definition", pin);
return NULL;
}
if (aio > board->aio_count) {
if (aio >= board->aio_count) {
syslog(LOG_ERR, "aio: requested channel out of range");
return NULL;
}