[Skiboot] [PATCH] nvram: Fix a possible NULL pointer de-ref in nvram_query_eq()

Vaibhav Jain vaibhav at linux.ibm.com
Fri Sep 14 16:16:15 AEST 2018

Oliver <oohall at gmail.com> writes:

> When I wrote that I briefly considered doing this, but I didn't becase
> "!nvram_query(key)" does the same job. It's also:
> a) shorter,
> b) clearly indicates that the value of the key is irrelevant, and
> c) doesn't force the reader to figure out if passing a NULL is fine
> and not a bug
Agree, to the points mentioned above. But how does they go against the
proposed patch ? IMHO we are just adding one more way to do the same
thing and in the process also making the function more robust for a
boundary case.

To me in this context, trigerring an assert or crashing due to a fault
will have the same impact.

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

More information about the Skiboot mailing list