Skip to content

Commit

Permalink
sound_firmware: don't pass crap to filp_close()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jul 29, 2012
1 parent 20818a0 commit 5860930
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sound/sound_firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ 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, current->files);
filp_close(filp, NULL);
return 0;
}
dp = vmalloc(l);
if (dp == NULL)
{
printk(KERN_INFO "Out of memory loading '%s'.\n", fn);
filp_close(filp, current->files);
filp_close(filp, NULL);
return 0;
}
pos = 0;
if (vfs_read(filp, dp, l, &pos) != l)
{
printk(KERN_INFO "Failed to read '%s'.\n", fn);
vfree(dp);
filp_close(filp, current->files);
filp_close(filp, NULL);
return 0;
}
filp_close(filp, current->files);
filp_close(filp, NULL);
*fp = dp;
return (int) l;
}
Expand Down

0 comments on commit 5860930

Please sign in to comment.