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

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Wed Sep 28 22:05:28 AEST 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 23f1b85..b89416c 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -870,7 +870,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