From 6a716f63ae37863fa5cc12aa2d8bccdb692d70f1 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sat, 15 Nov 2014 08:56:40 -0600 Subject: [PATCH] radeon_hd: Exit on GPIO pin space exhaustion * Prevents negative array index read * CID 1210885 --- src/add-ons/accelerants/radeon_hd/connector.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/add-ons/accelerants/radeon_hd/connector.cpp b/src/add-ons/accelerants/radeon_hd/connector.cpp index 2657b82a55..470421ed64 100644 --- a/src/add-ons/accelerants/radeon_hd/connector.cpp +++ b/src/add-ons/accelerants/radeon_hd/connector.cpp @@ -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++) {