diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-26 21:35:48 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 21:10:08 -0400 |
commit | bdbf69437a5ae6f820a6d3aa8c6e3c3ce7e6e05f (patch) | |
tree | 32ef1bc8863953cfc9abb6ef6de79cf7fea7088c /sound/core | |
parent | 4109633f4c4dcdaedf0d85ae74dba334760c577b (diff) |
switch SNDRV_PCM_IOCTL_LINK to fget_light()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/pcm_native.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 53b5ada8f7c..20554eff5a2 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1563,25 +1563,25 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream) /* WARNING: Don't forget to fput back the file */ -static struct file *snd_pcm_file_fd(int fd) +static struct file *snd_pcm_file_fd(int fd, int *fput_needed) { struct file *file; struct inode *inode; unsigned int minor; - file = fget(fd); + file = fget_light(fd, fput_needed); if (!file) return NULL; inode = file->f_path.dentry->d_inode; if (!S_ISCHR(inode->i_mode) || imajor(inode) != snd_major) { - fput(file); + fput_light(file, *fput_needed); return NULL; } minor = iminor(inode); if (!snd_lookup_minor_data(minor, SNDRV_DEVICE_TYPE_PCM_PLAYBACK) && !snd_lookup_minor_data(minor, SNDRV_DEVICE_TYPE_PCM_CAPTURE)) { - fput(file); + fput_light(file, *fput_needed); return NULL; } return file; @@ -1597,8 +1597,9 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) struct snd_pcm_file *pcm_file; struct snd_pcm_substream *substream1; struct snd_pcm_group *group; + int fput_needed; - file = snd_pcm_file_fd(fd); + file = snd_pcm_file_fd(fd, &fput_needed); if (!file) return -EBADFD; pcm_file = file->private_data; @@ -1633,7 +1634,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) write_unlock_irq(&snd_pcm_link_rwlock); up_write(&snd_pcm_link_rwsem); _nolock: - fput(file); + fput_light(file, fput_needed); if (res < 0) kfree(group); return res; |