From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio:buffer: Free active scan mask in iio_disable_all_buffers()
Date: Tue, 15 Oct 2013 19:23:10 +0100 [thread overview]
Message-ID: <525D880E.7050109@kernel.org> (raw)
In-Reply-To: <1381826312-26546-1-git-send-email-lars@metafoo.de>
On 10/15/13 09:38, Lars-Peter Clausen wrote:
> Usually the active scan mask is freed in __iio_update_buffers() when the buffer
> is disabled. But when the device is still sampling when it is removed we'll end
> up disabling the buffers in iio_disable_all_buffers(). So we also need to free
> the active scan mask here, otherwise it will be leaked.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Good spot. Applied to the togreg branch of iio.git
Thanks,
Jonathan
> ---
> drivers/iio/industrialio-buffer.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index 796376a..1c72080 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -490,6 +490,9 @@ void iio_disable_all_buffers(struct iio_dev *indio_dev)
> indio_dev->currentmode = INDIO_DIRECT_MODE;
> if (indio_dev->setup_ops->postdisable)
> indio_dev->setup_ops->postdisable(indio_dev);
> +
> + if (indio_dev->available_scan_masks == NULL)
> + kfree(indio_dev->active_scan_mask);
> }
>
> static int __iio_update_buffers(struct iio_dev *indio_dev,
>
next prev parent reply other threads:[~2013-10-15 17:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 8:38 [PATCH] iio:buffer: Free active scan mask in iio_disable_all_buffers() Lars-Peter Clausen
2013-10-15 18:23 ` Jonathan Cameron [this message]
2013-10-15 18:27 ` 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=525D880E.7050109@kernel.org \
--to=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@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.