Skip to content

Commit

Permalink
sound: sound_firmware: Fix invalid use of vfs_read()
Browse files Browse the repository at this point in the history
It should use kernel_read() instead of vfs_read() to load a firmware
binary onto the kernel pages.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed May 26, 2015
1 parent 574d69c commit 0d769a5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sound/sound_firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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);
Expand Down

0 comments on commit 0d769a5

Please sign in to comment.