diff options
author | Colin Ian King <colin.king@canonical.com> | 2020-01-21 16:17:57 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-23 10:38:24 +0200 |
commit | f05e96fcc81b62e74cfb4de5fd42ddd15ccbbc75 (patch) | |
tree | fe9f8b4ef6a8aa49b879238e70074b79b68692a9 /kernel | |
parent | 50167bd50b7896ef34e2b783f6f1bcca1eda776e (diff) |
iio: st_sensors: handle memory allocation failure to fix null pointer dereference
commit 9960c70949d4356abed8747a20637e0946bb0bad upstream.
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: 3ce85cc4fbb7 ("iio: st_sensors: get platform data from device tree")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions