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
2a58fce2
Commit
2a58fce2
authored
Feb 11, 2005
by
Tom 'spot' Callaway
Committed by
David S. Miller
Feb 11, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC]: fb: Fix putcmap handling in sbuslib
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
12853bfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
drivers/video/sbuslib.c
drivers/video/sbuslib.c
+15
-6
No files found.
drivers/video/sbuslib.c
View file @
2a58fce2
...
@@ -108,6 +108,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
...
@@ -108,6 +108,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
struct
fbcmap
__user
*
c
=
(
struct
fbcmap
__user
*
)
arg
;
struct
fbcmap
__user
*
c
=
(
struct
fbcmap
__user
*
)
arg
;
struct
fb_cmap
cmap
;
struct
fb_cmap
cmap
;
u16
red
,
green
,
blue
;
u16
red
,
green
,
blue
;
u8
red8
,
green8
,
blue8
;
unsigned
char
__user
*
ured
;
unsigned
char
__user
*
ured
;
unsigned
char
__user
*
ugreen
;
unsigned
char
__user
*
ugreen
;
unsigned
char
__user
*
ublue
;
unsigned
char
__user
*
ublue
;
...
@@ -128,11 +129,15 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
...
@@ -128,11 +129,15 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
for
(
i
=
0
;
i
<
count
;
i
++
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
int
err
;
int
err
;
if
(
get_user
(
red
,
&
ured
[
i
])
||
if
(
get_user
(
red
8
,
&
ured
[
i
])
||
get_user
(
green
,
&
ugreen
[
i
])
||
get_user
(
green
8
,
&
ugreen
[
i
])
||
get_user
(
blue
,
&
ublue
[
i
]))
get_user
(
blue
8
,
&
ublue
[
i
]))
return
-
EFAULT
;
return
-
EFAULT
;
red
=
red8
<<
8
;
green
=
green8
<<
8
;
blue
=
blue8
<<
8
;
cmap
.
start
=
index
+
i
;
cmap
.
start
=
index
+
i
;
err
=
fb_set_cmap
(
&
cmap
,
info
);
err
=
fb_set_cmap
(
&
cmap
,
info
);
if
(
err
)
if
(
err
)
...
@@ -147,6 +152,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
...
@@ -147,6 +152,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
unsigned
char
__user
*
ublue
;
unsigned
char
__user
*
ublue
;
struct
fb_cmap
*
cmap
=
&
info
->
cmap
;
struct
fb_cmap
*
cmap
=
&
info
->
cmap
;
int
index
,
count
,
i
;
int
index
,
count
,
i
;
u8
red
,
green
,
blue
;
if
(
get_user
(
index
,
&
c
->
index
)
||
if
(
get_user
(
index
,
&
c
->
index
)
||
__get_user
(
count
,
&
c
->
count
)
||
__get_user
(
count
,
&
c
->
count
)
||
...
@@ -159,9 +165,12 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
...
@@ -159,9 +165,12 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
return
-
EINVAL
;
return
-
EINVAL
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
put_user
(
cmap
->
red
[
index
+
i
],
&
ured
[
i
])
||
red
=
cmap
->
red
[
index
+
i
]
>>
8
;
put_user
(
cmap
->
green
[
index
+
i
],
&
ugreen
[
i
])
||
green
=
cmap
->
green
[
index
+
i
]
>>
8
;
put_user
(
cmap
->
blue
[
index
+
i
],
&
ublue
[
i
]))
blue
=
cmap
->
blue
[
index
+
i
]
>>
8
;
if
(
put_user
(
red
,
&
ured
[
i
])
||
put_user
(
green
,
&
ugreen
[
i
])
||
put_user
(
blue
,
&
ublue
[
i
]))
return
-
EFAULT
;
return
-
EFAULT
;
}
}
return
0
;
return
0
;
...
...
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