Re: [mfd] question about potential null pointer dereference

From: Gustavo A. R. Silva
Date: Wed May 24 2017 - 04:20:09 EST


Hi guys,

Quoting Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxxxxxxxx>:

On Wed, May 24, 2017 at 08:22:58AM +0100, Lee Jones wrote:
On Tue, 23 May 2017, Gustavo A. R. Silva wrote:
> The issue here is that there is a potential NULL pointer dereference at line
> 37, in case function of_match_device() returns NULL.
>
> Maybe a patch like the following could be applied in order to avoid any
> chance of a NULL pointer dereference:

I do not believe it's possible for of_match_device() to return NULL in
this case.

However, if you wanted to submit a patch checking for it, it would not
be rejected.

Personally I would prefer to have a NULL pointer check in there.


I'll send a patch shortly.

Thank you both.
--
Gustavo A. R. Silva