All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Peter Meerwald <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH] staging iio: fix potential memory leak in lis3l02dq_ring.c
Date: Mon, 27 Aug 2012 19:06:47 +0100	[thread overview]
Message-ID: <503BB737.6030701@kernel.org> (raw)
In-Reply-To: <1345664238-5446-1-git-send-email-pmeerw@pmeerw.net>

On 08/22/2012 08:37 PM, Peter Meerwald wrote:
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Thanks, merged to fixes-togreg.
> ---
>  drivers/staging/iio/accel/lis3l02dq_ring.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging/iio/accel/lis3l02dq_ring.c
> index 18d108f..f3da590 100644
> --- a/drivers/staging/iio/accel/lis3l02dq_ring.c
> +++ b/drivers/staging/iio/accel/lis3l02dq_ring.c
> @@ -121,8 +121,10 @@ static int lis3l02dq_get_buffer_element(struct iio_dev *indio_dev,
>  	if (rx_array == NULL)
>  		return -ENOMEM;
>  	ret = lis3l02dq_read_all(indio_dev, rx_array);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		kfree(rx_array);
>  		return ret;
> +	}
>  	for (i = 0; i < scan_count; i++)
>  		data[i] = combine_8_to_16(rx_array[i*4+1],
>  					rx_array[i*4+3]);
> 

      reply	other threads:[~2012-08-27 18:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 19:37 [PATCH] staging iio: fix potential memory leak in lis3l02dq_ring.c Peter Meerwald
2012-08-27 18:06 ` Jonathan Cameron [this message]

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=503BB737.6030701@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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.