summaryrefslogtreecommitdiffstats
path: root/drivers/iio/buffer_cb.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@kernel.org>2013-05-22 23:41:00 +0200
committerJonathan Cameron <jic23@kernel.org>2013-06-04 19:19:30 +0200
commit702df9f1819c7fc7e257251fabc5eec674342c32 (patch)
tree18005c1eb74567ca261ae1c511d463596109334f /drivers/iio/buffer_cb.c
parentstaging: alarm-dev: information leak in alarm_ioctl() (diff)
downloadlinux-702df9f1819c7fc7e257251fabc5eec674342c32.tar.xz
linux-702df9f1819c7fc7e257251fabc5eec674342c32.zip
iio:callback buffer: free the scan_mask
Reported-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/buffer_cb.c')
-rw-r--r--drivers/iio/buffer_cb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/iio/buffer_cb.c b/drivers/iio/buffer_cb.c
index 9201022945e9..9d19ba74f22b 100644
--- a/drivers/iio/buffer_cb.c
+++ b/drivers/iio/buffer_cb.c
@@ -64,7 +64,7 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
while (chan->indio_dev) {
if (chan->indio_dev != indio_dev) {
ret = -EINVAL;
- goto error_release_channels;
+ goto error_free_scan_mask;
}
set_bit(chan->channel->scan_index,
cb_buff->buffer.scan_mask);
@@ -73,6 +73,8 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
return cb_buff;
+error_free_scan_mask:
+ kfree(cb_buff->buffer.scan_mask);
error_release_channels:
iio_channel_release_all(cb_buff->channels);
error_free_cb_buff:
@@ -100,6 +102,7 @@ EXPORT_SYMBOL_GPL(iio_channel_stop_all_cb);
void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buff)
{
+ kfree(cb_buff->buffer.scan_mask);
iio_channel_release_all(cb_buff->channels);
kfree(cb_buff);
}