aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/firmware_class.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index e85763de928f..81541452887b 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -58,7 +58,6 @@ static noinline long fw_file_size(struct file *file)
58 58
59static bool fw_read_file_contents(struct file *file, struct firmware *fw) 59static bool fw_read_file_contents(struct file *file, struct firmware *fw)
60{ 60{
61 loff_t pos;
62 long size; 61 long size;
63 char *buf; 62 char *buf;
64 63
@@ -68,8 +67,7 @@ static bool fw_read_file_contents(struct file *file, struct firmware *fw)
68 buf = vmalloc(size); 67 buf = vmalloc(size);
69 if (!buf) 68 if (!buf)
70 return false; 69 return false;
71 pos = 0; 70 if (kernel_read(file, 0, buf, size) != size) {
72 if (vfs_read(file, buf, size, &pos) != size) {
73 vfree(buf); 71 vfree(buf);
74 return false; 72 return false;
75 } 73 }