diff options
author | Jonathan Cameron <jic23@kernel.org> | 2013-05-22 17:41:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-06-04 13:19:30 -0400 |
commit | 702df9f1819c7fc7e257251fabc5eec674342c32 (patch) | |
tree | 18005c1eb74567ca261ae1c511d463596109334f /drivers/iio/buffer_cb.c | |
parent | e919b86c3b018c0e0c5e522354e743dcc0824ee1 (diff) |
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.c | 5 |
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, | |||
64 | while (chan->indio_dev) { | 64 | while (chan->indio_dev) { |
65 | if (chan->indio_dev != indio_dev) { | 65 | if (chan->indio_dev != indio_dev) { |
66 | ret = -EINVAL; | 66 | ret = -EINVAL; |
67 | goto error_release_channels; | 67 | goto error_free_scan_mask; |
68 | } | 68 | } |
69 | set_bit(chan->channel->scan_index, | 69 | set_bit(chan->channel->scan_index, |
70 | cb_buff->buffer.scan_mask); | 70 | cb_buff->buffer.scan_mask); |
@@ -73,6 +73,8 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, | |||
73 | 73 | ||
74 | return cb_buff; | 74 | return cb_buff; |
75 | 75 | ||
76 | error_free_scan_mask: | ||
77 | kfree(cb_buff->buffer.scan_mask); | ||
76 | error_release_channels: | 78 | error_release_channels: |
77 | iio_channel_release_all(cb_buff->channels); | 79 | iio_channel_release_all(cb_buff->channels); |
78 | error_free_cb_buff: | 80 | error_free_cb_buff: |
@@ -100,6 +102,7 @@ EXPORT_SYMBOL_GPL(iio_channel_stop_all_cb); | |||
100 | 102 | ||
101 | void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buff) | 103 | void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buff) |
102 | { | 104 | { |
105 | kfree(cb_buff->buffer.scan_mask); | ||
103 | iio_channel_release_all(cb_buff->channels); | 106 | iio_channel_release_all(cb_buff->channels); |
104 | kfree(cb_buff); | 107 | kfree(cb_buff); |
105 | } | 108 | } |