[Skiboot] [PATCH] hdata: Make sure FW feature name is not NULL

Vaibhav Jain vaibhav at linux.vnet.ibm.com
Wed Sep 12 12:30:40 AEST 2018


Hi Vasant,

Bikeshedding a bit but a minor review comment:

"hdata: Make sure FW feature name is not NULL"

I think it should be "not Empty" rather than "not NULL" since you are
checking for length and 'name' and 'feature->name' being a static arrays
wont be NULL.

Vasant Hegde <hegdevasant at linux.vnet.ibm.com> writes:

> CC: Oliver O'Halloran <oohall at gmail.com>
> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
> ---
>  hdata/spira.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/hdata/spira.c b/hdata/spira.c
> index c820c4daf..3a26f17ae 100644
> --- a/hdata/spira.c
> +++ b/hdata/spira.c
> @@ -1213,6 +1213,11 @@ static void add_iplparams_features(const struct HDIF_common_hdr *iplp)
>  		name[sizeof(name)-1] = '\0';
>  		flags = be64_to_cpu(feature->flags);
>
> +		if (strlen(name) == 0) {
> +			prlog(PR_DEBUG, "IPLPARAMS: FW feature name is NULL\n");
> +			continue;
> +		}
> +

-- 
Vaibhav Jain <vaibhav at linux.vnet.ibm.com>
Linux Technology Center, IBM India Pvt. Ltd.



More information about the Skiboot mailing list