From: Jonathan Cameron <jic23@cam.ac.uk>
To: Dan Carpenter <error27@gmail.com>,
Greg Kroah-Hartman <gregkh@suse.de>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] iio: test for failed allocation
Date: Tue, 16 Mar 2010 10:58:32 +0000 [thread overview]
Message-ID: <4B9F64DC.3080602@cam.ac.uk> (raw)
In-Reply-To: <20100316100349.GA4219@bicker>
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@gmail.com>
Indeed. Another one for the stupid errors pile!
Thanks.
Acked-by: Jonathan Cameron <jic23@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;
>
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Dan Carpenter <error27@gmail.com>,
Greg Kroah-Hartman <gregkh@suse.de>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] iio: test for failed allocation
Date: Tue, 16 Mar 2010 11:00:44 +0000 [thread overview]
Message-ID: <4B9F64DC.3080602@cam.ac.uk> (raw)
In-Reply-To: <20100316100349.GA4219@bicker>
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@gmail.com>
Indeed. Another one for the stupid errors pile!
Thanks.
Acked-by: Jonathan Cameron <jic23@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;
>
next prev parent reply other threads:[~2010-03-16 10:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-16 10:03 [patch] iio: test for failed allocation Dan Carpenter
2010-03-16 10:03 ` Dan Carpenter
2010-03-16 10:58 ` Jonathan Cameron [this message]
2010-03-16 11:00 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B9F64DC.3080602@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=devel@driverdev.osuosl.org \
--cc=error27@gmail.com \
--cc=gregkh@suse.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.