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
b36180a3
Commit
b36180a3
authored
May 24, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch compat_drm_addmap() to drm_ioctl_kernel()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
8547ee9d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
drivers/gpu/drm/drm_ioc32.c
drivers/gpu/drm/drm_ioc32.c
+13
-20
No files found.
drivers/gpu/drm/drm_ioc32.c
View file @
b36180a3
...
@@ -194,35 +194,28 @@ static int compat_drm_addmap(struct file *file, unsigned int cmd,
...
@@ -194,35 +194,28 @@ static int compat_drm_addmap(struct file *file, unsigned int cmd,
{
{
drm_map32_t
__user
*
argp
=
(
void
__user
*
)
arg
;
drm_map32_t
__user
*
argp
=
(
void
__user
*
)
arg
;
drm_map32_t
m32
;
drm_map32_t
m32
;
struct
drm_map
__user
*
map
;
struct
drm_map
map
;
int
err
;
int
err
;
void
*
handle
;
if
(
copy_from_user
(
&
m32
,
argp
,
sizeof
(
m32
)))
if
(
copy_from_user
(
&
m32
,
argp
,
sizeof
(
m32
)))
return
-
EFAULT
;
return
-
EFAULT
;
map
=
compat_alloc_user_space
(
sizeof
(
*
map
));
map
.
offset
=
m32
.
offset
;
if
(
!
map
)
map
.
size
=
m32
.
size
;
return
-
EFAULT
;
map
.
type
=
m32
.
type
;
if
(
__put_user
(
m32
.
offset
,
&
map
->
offset
)
map
.
flags
=
m32
.
flags
;
||
__put_user
(
m32
.
size
,
&
map
->
size
)
||
__put_user
(
m32
.
type
,
&
map
->
type
)
||
__put_user
(
m32
.
flags
,
&
map
->
flags
))
return
-
EFAULT
;
err
=
drm_ioctl
(
file
,
DRM_IOCTL_ADD_MAP
,
(
unsigned
long
)
map
);
err
=
drm_ioctl_kernel
(
file
,
drm_legacy_addmap_ioctl
,
&
map
,
DRM_AUTH
|
DRM_MASTER
|
DRM_ROOT_ONLY
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
if
(
__get_user
(
m32
.
offset
,
&
map
->
offset
)
m32
.
offset
=
map
.
offset
;
||
__get_user
(
m32
.
mtrr
,
&
map
->
mtrr
)
m32
.
mtrr
=
map
.
mtrr
;
||
__get_user
(
handle
,
&
map
->
handle
))
m32
.
handle
=
ptr_to_compat
(
map
.
handle
);
return
-
EFAULT
;
if
(
map
.
handle
!=
compat_ptr
(
m32
.
handle
))
m32
.
handle
=
(
unsigned
long
)
handle
;
if
(
m32
.
handle
!=
(
unsigned
long
)
handle
)
pr_err_ratelimited
(
"compat_drm_addmap truncated handle %p for type %d offset %x
\n
"
,
pr_err_ratelimited
(
"compat_drm_addmap truncated handle %p for type %d offset %x
\n
"
,
handle
,
m32
.
type
,
m32
.
offset
);
map
.
handle
,
m32
.
type
,
m32
.
offset
);
if
(
copy_to_user
(
argp
,
&
m32
,
sizeof
(
m32
)))
if
(
copy_to_user
(
argp
,
&
m32
,
sizeof
(
m32
)))
return
-
EFAULT
;
return
-
EFAULT
;
...
@@ -1021,7 +1014,7 @@ static struct {
...
@@ -1021,7 +1014,7 @@ static struct {
DRM_IOCTL32_DEF
(
DRM_IOCTL_GET_CLIENT
,
compat_drm_getclient
),
DRM_IOCTL32_DEF
(
DRM_IOCTL_GET_CLIENT
,
compat_drm_getclient
),
DRM_IOCTL32_DEF
(
DRM_IOCTL_GET_STATS
,
compat_drm_getstats
),
DRM_IOCTL32_DEF
(
DRM_IOCTL_GET_STATS
,
compat_drm_getstats
),
DRM_IOCTL32_DEF
(
DRM_IOCTL_SET_UNIQUE
,
compat_drm_setunique
),
DRM_IOCTL32_DEF
(
DRM_IOCTL_SET_UNIQUE
,
compat_drm_setunique
),
[
DRM_IOCTL_NR
(
DRM_IOCTL_ADD_MAP32
)].
fn
=
compat_drm_addmap
,
DRM_IOCTL32_DEF
(
DRM_IOCTL_ADD_MAP
,
compat_drm_addmap
)
,
DRM_IOCTL32_DEF
(
DRM_IOCTL_ADD_BUFS
,
compat_drm_addbufs
),
DRM_IOCTL32_DEF
(
DRM_IOCTL_ADD_BUFS
,
compat_drm_addbufs
),
[
DRM_IOCTL_NR
(
DRM_IOCTL_MARK_BUFS32
)].
fn
=
compat_drm_markbufs
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_MARK_BUFS32
)].
fn
=
compat_drm_markbufs
,
DRM_IOCTL32_DEF
(
DRM_IOCTL_INFO_BUFS
,
compat_drm_infobufs
),
DRM_IOCTL32_DEF
(
DRM_IOCTL_INFO_BUFS
,
compat_drm_infobufs
),
...
...
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