Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

Al Viro 434b5a2e 264bd660

+5 -4
+5 -4
sound/sound_firmware.c
··· 1 1 #include <linux/vmalloc.h> 2 2 #include <linux/module.h> 3 3 #include <linux/fs.h> 4 + #include <linux/file.h> 4 5 #include <linux/mm.h> 5 6 #include <linux/sched.h> 6 7 #include <asm/uaccess.h> ··· 24 23 if (l <= 0 || l > 131072) 25 24 { 26 25 printk(KERN_INFO "Invalid firmware '%s'\n", fn); 27 - filp_close(filp, NULL); 26 + fput(filp); 28 27 return 0; 29 28 } 30 29 dp = vmalloc(l); 31 30 if (dp == NULL) 32 31 { 33 32 printk(KERN_INFO "Out of memory loading '%s'.\n", fn); 34 - filp_close(filp, NULL); 33 + fput(filp); 35 34 return 0; 36 35 } 37 36 pos = 0; ··· 39 38 { 40 39 printk(KERN_INFO "Failed to read '%s'.\n", fn); 41 40 vfree(dp); 42 - filp_close(filp, NULL); 41 + fput(filp); 43 42 return 0; 44 43 } 45 - filp_close(filp, NULL); 44 + fput(filp); 46 45 *fp = dp; 47 46 return (int) l; 48 47 }