mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-19 21:44:08 +00:00
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>
This commit is contained in:
parent
574d69c27b
commit
0d769a523a
1 changed files with 1 additions and 3 deletions
|
@ -12,7 +12,6 @@ static int do_mod_firmware_load(const char *fn, char **fp)
|
||||||
struct file* filp;
|
struct file* filp;
|
||||||
long l;
|
long l;
|
||||||
char *dp;
|
char *dp;
|
||||||
loff_t pos;
|
|
||||||
|
|
||||||
filp = filp_open(fn, 0, 0);
|
filp = filp_open(fn, 0, 0);
|
||||||
if (IS_ERR(filp))
|
if (IS_ERR(filp))
|
||||||
|
@ -34,8 +33,7 @@ static int do_mod_firmware_load(const char *fn, char **fp)
|
||||||
fput(filp);
|
fput(filp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
pos = 0;
|
if (kernel_read(filp, 0, dp, l) != l)
|
||||||
if (vfs_read(filp, dp, l, &pos) != l)
|
|
||||||
{
|
{
|
||||||
printk(KERN_INFO "Failed to read '%s'.\n", fn);
|
printk(KERN_INFO "Failed to read '%s'.\n", fn);
|
||||||
vfree(dp);
|
vfree(dp);
|
||||||
|
|
Loading…
Add table
Reference in a new issue