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
88a89037
Commit
88a89037
authored
Jan 07, 2018
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace_user_tlv(): switch to vmemdup_user()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
50fd2f29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
sound/core/control.c
sound/core/control.c
+5
-4
No files found.
sound/core/control.c
View file @
88a89037
...
...
@@ -25,6 +25,7 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/time.h>
#include <linux/mm.h>
#include <linux/sched/signal.h>
#include <sound/core.h>
#include <sound/minors.h>
...
...
@@ -1129,7 +1130,7 @@ static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf,
if
(
size
>
1024
*
128
)
/* sane value */
return
-
EINVAL
;
container
=
memdup_user
(
buf
,
size
);
container
=
v
memdup_user
(
buf
,
size
);
if
(
IS_ERR
(
container
))
return
PTR_ERR
(
container
);
...
...
@@ -1137,7 +1138,7 @@ static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf,
if
(
!
change
)
change
=
memcmp
(
ue
->
tlv_data
,
container
,
size
)
!=
0
;
if
(
!
change
)
{
kfree
(
container
);
k
v
free
(
container
);
return
0
;
}
...
...
@@ -1148,7 +1149,7 @@ static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf,
mask
=
SNDRV_CTL_EVENT_MASK_INFO
;
}
kfree
(
ue
->
tlv_data
);
k
v
free
(
ue
->
tlv_data
);
ue
->
tlv_data
=
container
;
ue
->
tlv_data_size
=
size
;
...
...
@@ -1225,7 +1226,7 @@ static void snd_ctl_elem_user_free(struct snd_kcontrol *kcontrol)
{
struct
user_element
*
ue
=
kcontrol
->
private_data
;
kfree
(
ue
->
tlv_data
);
k
v
free
(
ue
->
tlv_data
);
kfree
(
ue
->
priv_data
);
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