提交 f6c23f48 编写于 作者: L Lars-Peter Clausen 提交者: Jonathan Cameron

iio:kfifo: Fix memory leak

We need to free the kfifo when we release the buffer, otherwise the fifos memory
will be leaked.
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 ef4d4d1b
......@@ -132,7 +132,10 @@ static int iio_read_first_n_kfifo(struct iio_buffer *r,
static void iio_kfifo_buffer_release(struct iio_buffer *buffer)
{
kfree(iio_to_kfifo(buffer));
struct iio_kfifo *kf = iio_to_kfifo(buffer);
kfifo_free(&kf->kf);
kfree(kf);
}
static const struct iio_buffer_access_funcs kfifo_access_funcs = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册