[Skiboot] [PATCH v2 06/12] hdat: add_iplparams_serial - Validate HDIF_get_iarray_size() return value

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Sun Oct 30 01:36:29 AEDT 2016


Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hdata/spira.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hdata/spira.c b/hdata/spira.c
index 9481bb6..2066426 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -884,7 +884,7 @@ static void add_iplparams_serials(const void *iplp, struct dt_node *node)
 	int count, i;
 	
 	count = HDIF_get_iarray_size(iplp, IPLPARMS_IDATA_SERIAL);
-	if (!count) {
+	if (count <= 0) {
 		prerror("IPLPARAMS: No serial ports\n");
 		return;
 	}
-- 
2.5.5



More information about the Skiboot mailing list