summaryrefslogtreecommitdiffstats
path: root/drivers/iio/industrialio-buffer.c
diff options
context:
space:
mode:
authorOctavian Purdila <octavian.purdila@intel.com>2014-12-21 02:42:26 +0200
committerJonathan Cameron <jic23@kernel.org>2015-01-05 18:59:57 +0000
commit66ad1fd025c7cb9d0d4d01de965c80871226f422 (patch)
tree45e943902187fc81efe414a578f2a5d9f1511d8e /drivers/iio/industrialio-buffer.c
parent8f5d8727a7736024f28101b922d23754c67c2cc8 (diff)
downloadtalos-obmc-linux-66ad1fd025c7cb9d0d4d01de965c80871226f422.tar.gz
talos-obmc-linux-66ad1fd025c7cb9d0d4d01de965c80871226f422.zip
iio: buffer: fix custom buffer attributes copy
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/industrialio-buffer.c')
-rw-r--r--drivers/iio/industrialio-buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 2bd8d399f2ec..403b72878b0b 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -789,7 +789,7 @@ int iio_buffer_alloc_sysfs_and_mask(struct iio_dev *indio_dev)
buffer->buffer_group.attrs[1] = &dev_attr_enable.attr;
if (buffer->attrs)
memcpy(&buffer->buffer_group.attrs[2], buffer->attrs,
- sizeof(*&buffer->buffer_group.attrs) * (attrcount - 2));
+ sizeof(*&buffer->buffer_group.attrs) * attrcount);
buffer->buffer_group.attrs[attrcount+2] = NULL;
indio_dev->groups[indio_dev->groupcounter++] = &buffer->buffer_group;
OpenPOWER on IntegriCloud