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
nexedi
linux
Commits
fa52a4e0
Commit
fa52a4e0
authored
May 01, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: vicam: fix bugs in writing to proc files that were found by the CHECKER project
parent
474945e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
28 deletions
+2
-28
drivers/usb/media/vicam.c
drivers/usb/media/vicam.c
+2
-28
No files found.
drivers/usb/media/vicam.c
View file @
fa52a4e0
...
...
@@ -1101,28 +1101,6 @@ static int vicam_read_proc_gain(char *page, char **start, off_t off,
((
struct
vicam_camera
*
)
data
)
->
gain
);
}
static
int
vicam_write_proc_shutter
(
struct
file
*
file
,
const
char
*
buffer
,
unsigned
long
count
,
void
*
data
)
{
struct
vicam_camera
*
cam
=
(
struct
vicam_camera
*
)
data
;
cam
->
shutter_speed
=
simple_strtoul
(
buffer
,
NULL
,
10
);
return
count
;
}
static
int
vicam_write_proc_gain
(
struct
file
*
file
,
const
char
*
buffer
,
unsigned
long
count
,
void
*
data
)
{
struct
vicam_camera
*
cam
=
(
struct
vicam_camera
*
)
data
;
cam
->
gain
=
simple_strtoul
(
buffer
,
NULL
,
10
);
return
count
;
}
static
void
vicam_create_proc_root
(
void
)
{
...
...
@@ -1164,21 +1142,17 @@ vicam_create_proc_entry(struct vicam_camera *cam)
if
(
!
cam
->
proc_dir
)
return
;
// We should probably return an error here
ent
=
create_proc_entry
(
"shutter"
,
S_IFREG
|
S_IRUGO
|
S_IWUSR
,
cam
->
proc_dir
);
create_proc_entry
(
"shutter"
,
S_IFREG
|
S_IRUGO
,
cam
->
proc_dir
);
if
(
ent
)
{
ent
->
data
=
cam
;
ent
->
read_proc
=
vicam_read_proc_shutter
;
ent
->
write_proc
=
vicam_write_proc_shutter
;
ent
->
size
=
64
;
}
ent
=
create_proc_entry
(
"gain"
,
S_IFREG
|
S_IRUGO
|
S_IWUSR
,
cam
->
proc_dir
);
ent
=
create_proc_entry
(
"gain"
,
S_IFREG
|
S_IRUGO
,
cam
->
proc_dir
);
if
(
ent
)
{
ent
->
data
=
cam
;
ent
->
read_proc
=
vicam_read_proc_gain
;
ent
->
write_proc
=
vicam_write_proc_gain
;
ent
->
size
=
64
;
}
}
...
...
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