OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d43102f
)
iio: adc: fix a potential NULL pointer dereference
author
Kangjie Lu
<kjlu@umn.edu>
Sat, 9 Mar 2019 04:53:55 +0000
(22:53 -0600)
committer
Jonathan Cameron
<Jonathan.Cameron@huawei.com>
Thu, 4 Apr 2019 19:19:53 +0000
(20:19 +0100)
devm_iio_trigger_alloc may fail and return NULL. The fix returns
ENOMEM when it fails.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/mxs-lradc-adc.c
patch
|
blob
|
history
diff --git
a/drivers/iio/adc/mxs-lradc-adc.c
b/drivers/iio/adc/mxs-lradc-adc.c
index
c627513
..
5384472
100644
(file)
--- a/
drivers/iio/adc/mxs-lradc-adc.c
+++ b/
drivers/iio/adc/mxs-lradc-adc.c
@@
-465,6
+465,8
@@
static int mxs_lradc_adc_trigger_init(struct iio_dev *iio)
trig = devm_iio_trigger_alloc(&iio->dev, "%s-dev%i", iio->name,
iio->id);
+ if (!trig)
+ return -ENOMEM;
trig->dev.parent = adc->dev;
iio_trigger_set_drvdata(trig, iio);