Commit 702df9f1 authored by Jonathan Cameron's avatar Jonathan Cameron

iio:callback buffer: free the scan_mask

Reported-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent e919b86c
...@@ -64,7 +64,7 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, ...@@ -64,7 +64,7 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
while (chan->indio_dev) { while (chan->indio_dev) {
if (chan->indio_dev != indio_dev) { if (chan->indio_dev != indio_dev) {
ret = -EINVAL; ret = -EINVAL;
goto error_release_channels; goto error_free_scan_mask;
} }
set_bit(chan->channel->scan_index, set_bit(chan->channel->scan_index,
cb_buff->buffer.scan_mask); cb_buff->buffer.scan_mask);
...@@ -73,6 +73,8 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, ...@@ -73,6 +73,8 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
return cb_buff; return cb_buff;
error_free_scan_mask:
kfree(cb_buff->buffer.scan_mask);
error_release_channels: error_release_channels:
iio_channel_release_all(cb_buff->channels); iio_channel_release_all(cb_buff->channels);
error_free_cb_buff: error_free_cb_buff:
...@@ -100,6 +102,7 @@ EXPORT_SYMBOL_GPL(iio_channel_stop_all_cb); ...@@ -100,6 +102,7 @@ EXPORT_SYMBOL_GPL(iio_channel_stop_all_cb);
void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buff) 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); iio_channel_release_all(cb_buff->channels);
kfree(cb_buff); kfree(cb_buff);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment