Prev: Please pull bjdooks' for-linus/samsung-fixes
Next: sys_umount() returns EBUSY when doing: sh -c "mount /dev/sdc1 /mnt; umount /mnt"
From: Jonathan Cameron on 16 Mar 2010 07:00 On 03/16/10 10:03, Dan Carpenter wrote: > We should return test to see if iio_allocate_trigger() fails and return -ENOMEM. > > Signed-off-by: Dan Carpenter <error27(a)gmail.com> Indeed. Another one for the stupid errors pile! Thanks. Acked-by: Jonathan Cameron <jic23(a)cam.ac.uk> > > diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging/iio/accel/lis3l02dq_ring.c > index a6b7c72..db3270f 100644 > --- a/drivers/staging/iio/accel/lis3l02dq_ring.c > +++ b/drivers/staging/iio/accel/lis3l02dq_ring.c > @@ -492,6 +492,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; > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |