Re: [PATCH v2] reset: hisilicon: fix potential NULL pointer dereference

From: Stephen Boyd
Date: Fri Aug 31 2018 - 13:36:59 EST


Quoting Gustavo A. R. Silva (2018-07-25 17:47:19)
> There is a potential execution path in which function
> platform_get_resource() returns NULL. If this happens,
> we will end up having a NULL pointer dereference.
>
> Fix this by replacing devm_ioremap with devm_ioremap_resource,
> which has the NULL check and the memory region request.
>
> This code was detected with the help of Coccinelle.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 97b7129cd2af ("reset: hisilicon: change the definition of hisi_reset_init")
> Signed-off-by: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>
> ---

Nobody has reviewed, so I guess applied to clk-next unless someone
complains.