OSDN Git Service
(root)
/
sagit-ice-cold
/
kernel_xiaomi_msm8998.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
9371243
..
a4d97ea
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;