Commit adf9e8ae authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Greg Kroah-Hartman

[PATCH] Driver Core: fix firmware binary files

Fixes the sysfs binary file bug.
parent 93482f5c
...@@ -149,7 +149,7 @@ firmware_data_read(struct kobject *kobj, ...@@ -149,7 +149,7 @@ firmware_data_read(struct kobject *kobj,
if (offset + count > fw->size) if (offset + count > fw->size)
count = fw->size - offset; count = fw->size - offset;
memcpy(buffer, fw->data + offset, count); memcpy(buffer + offset, fw->data + offset, count);
return count; return count;
} }
static int static int
...@@ -198,7 +198,7 @@ firmware_data_write(struct kobject *kobj, ...@@ -198,7 +198,7 @@ firmware_data_write(struct kobject *kobj,
if (retval) if (retval)
return retval; return retval;
memcpy(fw->data + offset, buffer, count); memcpy(fw->data + offset, buffer + offset, count);
fw->size = max_t(size_t, offset + count, fw->size); fw->size = max_t(size_t, offset + count, fw->size);
......
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