Commit ce684d95 authored by Akinobu Mita's avatar Akinobu Mita Committed by Greg Kroah-Hartman
parent 9c1c5e0b
...@@ -164,16 +164,7 @@ static struct class devcd_class = { ...@@ -164,16 +164,7 @@ static struct class devcd_class = {
static ssize_t devcd_readv(char *buffer, loff_t offset, size_t count, static ssize_t devcd_readv(char *buffer, loff_t offset, size_t count,
void *data, size_t datalen) void *data, size_t datalen)
{ {
if (offset > datalen) return memory_read_from_buffer(buffer, count, &offset, data, datalen);
return -EINVAL;
if (offset + count > datalen)
count = datalen - offset;
if (count)
memcpy(buffer, ((u8 *)data) + offset, count);
return count;
} }
static void devcd_freev(void *data) static void devcd_freev(void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment