Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
bdbf6943
Commit
bdbf6943
authored
Aug 26, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch SNDRV_PCM_IOCTL_LINK to fget_light()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
4109633f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
sound/core/pcm_native.c
sound/core/pcm_native.c
+7
-6
No files found.
sound/core/pcm_native.c
View file @
bdbf6943
...
@@ -1563,25 +1563,25 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream)
...
@@ -1563,25 +1563,25 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream)
/* WARNING: Don't forget to fput back the file */
/* 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
file
*
file
;
struct
inode
*
inode
;
struct
inode
*
inode
;
unsigned
int
minor
;
unsigned
int
minor
;
file
=
fget
(
f
d
);
file
=
fget
_light
(
fd
,
fput_neede
d
);
if
(
!
file
)
if
(
!
file
)
return
NULL
;
return
NULL
;
inode
=
file
->
f_path
.
dentry
->
d_inode
;
inode
=
file
->
f_path
.
dentry
->
d_inode
;
if
(
!
S_ISCHR
(
inode
->
i_mode
)
||
if
(
!
S_ISCHR
(
inode
->
i_mode
)
||
imajor
(
inode
)
!=
snd_major
)
{
imajor
(
inode
)
!=
snd_major
)
{
fput
(
file
);
fput
_light
(
file
,
*
fput_needed
);
return
NULL
;
return
NULL
;
}
}
minor
=
iminor
(
inode
);
minor
=
iminor
(
inode
);
if
(
!
snd_lookup_minor_data
(
minor
,
SNDRV_DEVICE_TYPE_PCM_PLAYBACK
)
&&
if
(
!
snd_lookup_minor_data
(
minor
,
SNDRV_DEVICE_TYPE_PCM_PLAYBACK
)
&&
!
snd_lookup_minor_data
(
minor
,
SNDRV_DEVICE_TYPE_PCM_CAPTURE
))
{
!
snd_lookup_minor_data
(
minor
,
SNDRV_DEVICE_TYPE_PCM_CAPTURE
))
{
fput
(
file
);
fput
_light
(
file
,
*
fput_needed
);
return
NULL
;
return
NULL
;
}
}
return
file
;
return
file
;
...
@@ -1597,8 +1597,9 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
...
@@ -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_file
*
pcm_file
;
struct
snd_pcm_substream
*
substream1
;
struct
snd_pcm_substream
*
substream1
;
struct
snd_pcm_group
*
group
;
struct
snd_pcm_group
*
group
;
int
fput_needed
;
file
=
snd_pcm_file_fd
(
fd
);
file
=
snd_pcm_file_fd
(
fd
,
&
fput_needed
);
if
(
!
file
)
if
(
!
file
)
return
-
EBADFD
;
return
-
EBADFD
;
pcm_file
=
file
->
private_data
;
pcm_file
=
file
->
private_data
;
...
@@ -1633,7 +1634,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
...
@@ -1633,7 +1634,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
write_unlock_irq
(
&
snd_pcm_link_rwlock
);
write_unlock_irq
(
&
snd_pcm_link_rwlock
);
up_write
(
&
snd_pcm_link_rwsem
);
up_write
(
&
snd_pcm_link_rwsem
);
_nolock:
_nolock:
fput
(
file
);
fput
_light
(
file
,
fput_needed
);
if
(
res
<
0
)
if
(
res
<
0
)
kfree
(
group
);
kfree
(
group
);
return
res
;
return
res
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment