diff options
-rw-r--r-- | drivers/base/devcoredump.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c index f1a3353f3494..3c960a63062f 100644 --- a/drivers/base/devcoredump.c +++ b/drivers/base/devcoredump.c @@ -164,16 +164,7 @@ static struct class devcd_class = { static ssize_t devcd_readv(char *buffer, loff_t offset, size_t count, void *data, size_t datalen) { - if (offset > datalen) - return -EINVAL; - - if (offset + count > datalen) - count = datalen - offset; - - if (count) - memcpy(buffer, ((u8 *)data) + offset, count); - - return count; + return memory_read_from_buffer(buffer, count, &offset, data, datalen); } static void devcd_freev(void *data) |