mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
sound_firmware: don't bother with filp_close()
it's opened read-only and never installed into any descriptor tables; fput() will do just as well. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
264bd6602e
commit
434b5a2e2d
1 changed files with 5 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
#include <linux/vmalloc.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/sched.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
@ -23,14 +24,14 @@ static int do_mod_firmware_load(const char *fn, char **fp)
|
|||
if (l <= 0 || l > 131072)
|
||||
{
|
||||
printk(KERN_INFO "Invalid firmware '%s'\n", fn);
|
||||
filp_close(filp, NULL);
|
||||
fput(filp);
|
||||
return 0;
|
||||
}
|
||||
dp = vmalloc(l);
|
||||
if (dp == NULL)
|
||||
{
|
||||
printk(KERN_INFO "Out of memory loading '%s'.\n", fn);
|
||||
filp_close(filp, NULL);
|
||||
fput(filp);
|
||||
return 0;
|
||||
}
|
||||
pos = 0;
|
||||
|
@ -38,10 +39,10 @@ static int do_mod_firmware_load(const char *fn, char **fp)
|
|||
{
|
||||
printk(KERN_INFO "Failed to read '%s'.\n", fn);
|
||||
vfree(dp);
|
||||
filp_close(filp, NULL);
|
||||
fput(filp);
|
||||
return 0;
|
||||
}
|
||||
filp_close(filp, NULL);
|
||||
fput(filp);
|
||||
*fp = dp;
|
||||
return (int) l;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue