summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-05-26 13:57:56 +0300
committerTakashi Iwai <tiwai@suse.de>2015-05-26 14:48:58 +0300
commit0d769a523a90e3e5cf20c8bb15626f82aea04c90 (patch)
treecbb3eb0f58466622a8ba460c3028a9b66b8a98f4
parent574d69c27b74f0ff18038dc6138b8c1510731cea (diff)
downloadlinux-0d769a523a90e3e5cf20c8bb15626f82aea04c90.tar.xz
sound: sound_firmware: Fix invalid use of vfs_read()
It should use kernel_read() instead of vfs_read() to load a firmware binary onto the kernel pages. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/sound_firmware.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/sound_firmware.c b/sound/sound_firmware.c
index b155137ee312..026347643c81 100644
--- a/sound/sound_firmware.c
+++ b/sound/sound_firmware.c
@@ -12,7 +12,6 @@ static int do_mod_firmware_load(const char *fn, char **fp)
struct file* filp;
long l;
char *dp;
- loff_t pos;
filp = filp_open(fn, 0, 0);
if (IS_ERR(filp))
@@ -34,8 +33,7 @@ static int do_mod_firmware_load(const char *fn, char **fp)
fput(filp);
return 0;
}
- pos = 0;
- if (vfs_read(filp, dp, l, &pos) != l)
+ if (kernel_read(filp, 0, dp, l) != l)
{
printk(KERN_INFO "Failed to read '%s'.\n", fn);
vfree(dp);