lkml.org 
[lkml]   [2015]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] configfs: Implement binary attributes (v3)
Date
Pantelis Antoniou <pantelis.antoniou <at> konsulko.com> writes:

...
> +static ssize_t
> +configfs_write_bin_file(struct file *file, const char __user *buf,
> + size_t count, loff_t *ppos)
> +{
...
> + len = simple_write_to_buffer(buffer->bin_buffer,
> + buffer->bin_buffer_size, ppos, buf, count);
> + if (len > 0)
> + *ppos += len;
> +out:
> + mutex_unlock(&buffer->mutex);
> + return len;
> +}
> +
...

It appears there is a small bug in this code. If you write more than one page
worth of data it incorrectly skips ahead. This code should NOT increment ppos
as the simple_write_to_buffer call already does that for you.

-- Chris Wulff



\
 
 \ /
  Last update: 2015-06-13 04:21    [W:3.145 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site