Re: [PATCH v2 01/11] iio: buffer: fix custom buffer attributes copy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/12/14 00:42, Octavian Purdila wrote:
> Signed-off-by: Octavian Purdila <octavian.purdila@xxxxxxxxx>
Definitely looks like a bug has snuck in here.  Lars, it's your bit of code.
Want to just sanity check this fix before I apply it?

Thanks,

Jonathan
> ---
>  drivers/iio/industrialio-buffer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index 2bd8d39..403b728 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;
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux