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
17e3dade
Commit
17e3dade
authored
May 24, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch compat_drm_getunique() to drm_ioctl_kernel()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
012c6741
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
14 deletions
+10
-14
drivers/gpu/drm/drm_internal.h
drivers/gpu/drm/drm_internal.h
+1
-0
drivers/gpu/drm/drm_ioc32.c
drivers/gpu/drm/drm_ioc32.c
+8
-13
drivers/gpu/drm/drm_ioctl.c
drivers/gpu/drm/drm_ioctl.c
+1
-1
No files found.
drivers/gpu/drm/drm_internal.h
View file @
17e3dade
...
...
@@ -144,3 +144,4 @@ static inline int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc)
}
#endif
drm_ioctl_t
drm_version
;
drm_ioctl_t
drm_getunique
;
drivers/gpu/drm/drm_ioc32.c
View file @
17e3dade
...
...
@@ -125,26 +125,21 @@ static int compat_drm_getunique(struct file *file, unsigned int cmd,
unsigned
long
arg
)
{
drm_unique32_t
uq32
;
struct
drm_unique
__user
*
u
;
struct
drm_unique
uq
;
int
err
;
if
(
copy_from_user
(
&
uq32
,
(
void
__user
*
)
arg
,
sizeof
(
uq32
)))
return
-
EFAULT
;
uq
=
(
struct
drm_unique
){
.
unique_len
=
uq32
.
unique_len
,
.
unique
=
compat_ptr
(
uq32
.
unique
),
};
u
=
compat_alloc_user_space
(
sizeof
(
*
u
));
if
(
!
u
)
return
-
EFAULT
;
if
(
__put_user
(
uq32
.
unique_len
,
&
u
->
unique_len
)
||
__put_user
((
void
__user
*
)(
unsigned
long
)
uq32
.
unique
,
&
u
->
unique
))
return
-
EFAULT
;
err
=
drm_ioctl
(
file
,
DRM_IOCTL_GET_UNIQUE
,
(
unsigned
long
)
u
);
err
=
drm_ioctl_kernel
(
file
,
drm_getunique
,
&
uq
,
DRM_UNLOCKED
);
if
(
err
)
return
err
;
if
(
__get_user
(
uq32
.
unique_len
,
&
u
->
unique_len
))
return
-
EFAULT
;
uq32
.
unique_len
=
uq
.
unique_len
;
if
(
copy_to_user
((
void
__user
*
)
arg
,
&
uq32
,
sizeof
(
uq32
)))
return
-
EFAULT
;
return
0
;
...
...
@@ -1072,7 +1067,7 @@ static struct {
}
drm_compat_ioctls
[]
=
{
#define DRM_IOCTL32_DEF(n, f) [DRM_IOCTL_NR(n##32)] = {.fn = f, .name = #n}
DRM_IOCTL32_DEF
(
DRM_IOCTL_VERSION
,
compat_drm_version
),
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_UNIQUE32
)].
fn
=
compat_drm_getunique
,
DRM_IOCTL32_DEF
(
DRM_IOCTL_GET_UNIQUE
,
compat_drm_getunique
)
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_MAP32
)].
fn
=
compat_drm_getmap
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_CLIENT32
)].
fn
=
compat_drm_getclient
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_STATS32
)].
fn
=
compat_drm_getstats
,
...
...
drivers/gpu/drm/drm_ioctl.c
View file @
17e3dade
...
...
@@ -107,7 +107,7 @@
*
* Copies the bus id from drm_device::unique into user space.
*/
static
int
drm_getunique
(
struct
drm_device
*
dev
,
void
*
data
,
int
drm_getunique
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file_priv
)
{
struct
drm_unique
*
u
=
data
;
...
...
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