radeon_hd: Exit on GPIO pin space exhaustion

* Prevents negative array index read
* CID 1210885
This commit is contained in:
Alexander von Gluck IV 2014-11-15 08:56:40 -06:00
parent f9ac1e93fb
commit 6a716f63ae

View File

@ -309,8 +309,10 @@ gpio_general_populate()
break;
}
}
if (gpioIndex < 0)
if (gpioIndex < 0) {
ERROR("%s: ERROR: Out of space for additional GPIO pins!\n", __func__);
return B_ERROR;
}
ATOM_GPIO_PIN_ASSIGNMENT* pin = gpioInfo->asGPIO_Pin;
for (int i = 0; i < numIndices; i++) {