diff mbox

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

Message ID 1477751795-20128-7-git-send-email-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Vasant Hegde Oct. 29, 2016, 2:36 p.m. UTC
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hdata/spira.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stewart Smith Dec. 20, 2016, 6:09 a.m. UTC | #1
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
> Signed-off-by: Vasant Hegde <hegdevasant@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;
>  	}

looks good, merged to master as of 6e0ec58
diff mbox

Patch

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;
 	}