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
59aeaf3f
Commit
59aeaf3f
authored
Jan 07, 2018
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snd_ctl_elem_init_enum_names(): switch to vmemdup_user()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
88a89037
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
sound/core/control.c
sound/core/control.c
+3
-3
No files found.
sound/core/control.c
View file @
59aeaf3f
...
@@ -1198,7 +1198,7 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue)
...
@@ -1198,7 +1198,7 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue)
if
(
ue
->
info
.
value
.
enumerated
.
names_length
>
64
*
1024
)
if
(
ue
->
info
.
value
.
enumerated
.
names_length
>
64
*
1024
)
return
-
EINVAL
;
return
-
EINVAL
;
names
=
memdup_user
((
const
void
__user
*
)
user_ptrval
,
names
=
v
memdup_user
((
const
void
__user
*
)
user_ptrval
,
ue
->
info
.
value
.
enumerated
.
names_length
);
ue
->
info
.
value
.
enumerated
.
names_length
);
if
(
IS_ERR
(
names
))
if
(
IS_ERR
(
names
))
return
PTR_ERR
(
names
);
return
PTR_ERR
(
names
);
...
@@ -1209,7 +1209,7 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue)
...
@@ -1209,7 +1209,7 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue)
for
(
i
=
0
;
i
<
ue
->
info
.
value
.
enumerated
.
items
;
++
i
)
{
for
(
i
=
0
;
i
<
ue
->
info
.
value
.
enumerated
.
items
;
++
i
)
{
name_len
=
strnlen
(
p
,
buf_len
);
name_len
=
strnlen
(
p
,
buf_len
);
if
(
name_len
==
0
||
name_len
>=
64
||
name_len
==
buf_len
)
{
if
(
name_len
==
0
||
name_len
>=
64
||
name_len
==
buf_len
)
{
kfree
(
names
);
k
v
free
(
names
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
p
+=
name_len
+
1
;
p
+=
name_len
+
1
;
...
@@ -1227,7 +1227,7 @@ static void snd_ctl_elem_user_free(struct snd_kcontrol *kcontrol)
...
@@ -1227,7 +1227,7 @@ static void snd_ctl_elem_user_free(struct snd_kcontrol *kcontrol)
struct
user_element
*
ue
=
kcontrol
->
private_data
;
struct
user_element
*
ue
=
kcontrol
->
private_data
;
kvfree
(
ue
->
tlv_data
);
kvfree
(
ue
->
tlv_data
);
kfree
(
ue
->
priv_data
);
k
v
free
(
ue
->
priv_data
);
kfree
(
ue
);
kfree
(
ue
);
}
}
...
...
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