Re: [PATCH 1/2] mfd: sm501: Fix potential NULL pointer dereference

From: Gustavo A. R. Silva
Date: Wed Jan 30 2019 - 19:16:19 EST




On 1/30/19 7:35 AM, Lee Jones wrote:
> On Tue, 22 Jan 2019, Gustavo A. R. Silva wrote:
>
>> There is a potential NULL pointer dereference in case devm_kzalloc()
>> fails and returns NULL.
>>
>> Fix this by adding a NULL check on *lookup*
>>
>> This bug was detected with the help of Coccinelle.
>>
>> Fixes: b2e63555592f ("i2c: gpio: Convert to use descriptors")
>> Cc: stable@xxxxxxxxxxxxxxx
>> Signed-off-by: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>
>> ---
>> drivers/mfd/sm501.c | 3 +++
>> 1 file changed, 3 insertions(+)
>
> Applied, thanks.
>

Thanks, Lee.

--
Gustavo