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
b9628e10
Commit
b9628e10
authored
Dec 29, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
948ff1ba
09619fdb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
kernel/module.c
kernel/module.c
+31
-1
No files found.
kernel/module.c
View file @
b9628e10
...
...
@@ -569,10 +569,19 @@ static int param_set_byte(const char *val, struct kernel_param *kp)
return
0
;
}
/* Bounds checking done below */
static
int
obsparm_copy_string
(
const
char
*
val
,
struct
kernel_param
*
kp
)
{
strcpy
(
kp
->
arg
,
val
);
return
0
;
}
extern
int
set_obsolete
(
const
char
*
val
,
struct
kernel_param
*
kp
)
{
unsigned
int
min
,
max
;
char
*
p
,
*
endp
;
unsigned
int
size
,
maxsize
;
char
*
endp
;
const
char
*
p
;
struct
obsolete_modparm
*
obsparm
=
kp
->
arg
;
if
(
!
val
)
{
...
...
@@ -606,9 +615,30 @@ extern int set_obsolete(const char *val, struct kernel_param *kp)
case
's'
:
return
param_array
(
kp
->
name
,
val
,
min
,
max
,
obsparm
->
addr
,
sizeof
(
char
*
),
param_set_charp
);
case
'c'
:
/* Undocumented: 1-5c50 means 1-5 strings of up to 49 chars,
and the decl is "char xxx[5][50];" */
p
=
endp
+
1
;
maxsize
=
simple_strtol
(
p
,
&
endp
,
10
);
/* We check lengths here (yes, this is a hack). */
p
=
val
;
while
(
p
[
size
=
strcspn
(
p
,
","
)])
{
if
(
size
>=
maxsize
)
goto
oversize
;
p
+=
size
+
1
;
}
if
(
size
>=
maxsize
)
goto
oversize
;
return
param_array
(
kp
->
name
,
val
,
min
,
max
,
obsparm
->
addr
,
maxsize
,
obsparm_copy_string
);
}
printk
(
KERN_ERR
"Unknown obsolete parameter type %s
\n
"
,
obsparm
->
type
);
return
-
EINVAL
;
oversize:
printk
(
KERN_ERR
"Parameter %s doesn't fit in %u chars.
\n
"
,
kp
->
name
,
maxsize
);
return
-
EINVAL
;
}
static
int
obsolete_params
(
const
char
*
name
,
...
...
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