Skip to content
Snippets Groups Projects
Commit 9960c709 authored by Colin Ian King's avatar Colin Ian King Committed by Jonathan Cameron
Browse files

iio: st_sensors: handle memory allocation failure to fix null pointer dereference


A null pointer deference on pdata can occur if the allocation of
pdata fails.  Fix this by adding a null pointer check and handle
the -ENOMEM failure in the caller.

Addresses-Coverity: ("Dereference null return value")
Fixes: 3ce85cc4 ("iio: st_sensors: get platform data from device tree")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent cef27609
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment