Skip to content

Commit

Permalink
sound: read i_size with i_size_read()
Browse files Browse the repository at this point in the history
Convert direct read of inode->i_size to using i_size_read().
i_size_read is guaranteed to return a valid value and
its caller does not need to use addtional locking.

Signed-off-by: Xiaochen Wang <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
chobits authored and tiwai committed Mar 18, 2011
1 parent d351cf4 commit 977a6ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/sound_firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static int do_mod_firmware_load(const char *fn, char **fp)
printk(KERN_INFO "Unable to load '%s'.\n", fn);
return 0;
}
l = filp->f_path.dentry->d_inode->i_size;
l = i_size_read(filp->f_path.dentry->d_inode);
if (l <= 0 || l > 131072)
{
printk(KERN_INFO "Invalid firmware '%s'\n", fn);
Expand Down

0 comments on commit 977a6ef

Please sign in to comment.