projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b64c38
)
Staging: iio: test for failed allocation
author
Dan Carpenter
<error27@gmail.com>
Tue, 16 Mar 2010 10:03:49 +0000
(13:03 +0300)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Fri, 30 Apr 2010 16:30:08 +0000
(09:30 -0700)
We should return test to see if iio_allocate_trigger() fails and return -ENOMEM.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/accel/lis3l02dq_ring.c
patch
|
blob
|
history
diff --git
a/drivers/staging/iio/accel/lis3l02dq_ring.c
b/drivers/staging/iio/accel/lis3l02dq_ring.c
index 93712430e579192f4a9b6528d24aedc360f3ade1..a4d97ea0df3d8adc73b0e5c6f515c2b5cfbf5c49 100644
(file)
--- a/
drivers/staging/iio/accel/lis3l02dq_ring.c
+++ b/
drivers/staging/iio/accel/lis3l02dq_ring.c
@@
-493,6
+493,9
@@
int lis3l02dq_probe_trigger(struct iio_dev *indio_dev)
struct lis3l02dq_state *state = indio_dev->dev_data;
state->trig = iio_allocate_trigger();
+ if (!state->trig)
+ return -ENOMEM;
+
state->trig->name = kmalloc(IIO_TRIGGER_NAME_LENGTH, GFP_KERNEL);
if (!state->trig->name) {
ret = -ENOMEM;