staging:iio: Disallow modifying buffer size when buffer is enabled
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 19 Dec 2011 14:23:44 +0000 (15:23 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Dec 2011 21:38:07 +0000 (13:38 -0800)
commite38c79e0825b673d97cecfb36bae9e859e724f1b
treedd36c49256e390391012c5185ace25ffe2aaa374
parent5fd6218ca5928e4b59eb8a496aa1428fae1fb0d6
staging:iio: Disallow modifying buffer size when buffer is enabled

The buffer buffer storage is only update when enabling the buffer. Changing the
buffer size while the buffer is enabled will confuse the buffer in regard to
its actual buffer size and can cause potential memory corruption. Thus it is
only safe to modify the buffer size when the buffer is disabled.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/industrialio-buffer.c