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
21fed407
Commit
21fed407
authored
Apr 11, 2003
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BRIDGE]: Kill excessive stack usage in br_ioctl.
parent
419c3e2e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
net/bridge/br_ioctl.c
net/bridge/br_ioctl.c
+23
-15
No files found.
net/bridge/br_ioctl.c
View file @
21fed407
...
...
@@ -84,17 +84,20 @@ static int br_ioctl_device(struct net_bridge *br,
case
BRCTL_GET_PORT_LIST
:
{
int
i
;
int
indices
[
256
]
;
int
*
indices
;
int
ret
=
0
;
for
(
i
=
0
;
i
<
256
;
i
++
)
indices
[
i
]
=
0
;
indices
=
kmalloc
(
256
*
sizeof
(
int
),
GFP_KERNEL
);
if
(
indices
==
NULL
)
return
-
ENOMEM
;
memset
(
indices
,
0
,
256
*
sizeof
(
int
));
br_get_port_ifindices
(
br
,
indices
);
if
(
copy_to_user
((
void
*
)
arg0
,
indices
,
256
*
sizeof
(
int
)))
ret
urn
-
EFAULT
;
return
0
;
ret
=
-
EFAULT
;
kfree
(
indices
);
return
ret
;
}
case
BRCTL_SET_BRIDGE_FORWARD_DELAY
:
...
...
@@ -212,19 +215,24 @@ static int br_ioctl_deviceless(unsigned int cmd,
case
BRCTL_GET_BRIDGES
:
{
int
i
;
int
indices
[
64
];
for
(
i
=
0
;
i
<
64
;
i
++
)
indices
[
i
]
=
0
;
int
*
indices
;
int
ret
=
0
;
if
(
arg1
>
64
)
arg1
=
64
;
indices
=
kmalloc
(
arg1
*
sizeof
(
int
),
GFP_KERNEL
);
if
(
indices
==
NULL
)
return
-
ENOMEM
;
memset
(
indices
,
0
,
arg1
*
sizeof
(
int
));
arg1
=
br_get_bridge_ifindices
(
indices
,
arg1
);
if
(
copy_to_user
((
void
*
)
arg0
,
indices
,
arg1
*
sizeof
(
int
)))
return
-
EFAULT
;
return
arg1
;
ret
=
copy_to_user
((
void
*
)
arg0
,
indices
,
arg1
*
sizeof
(
int
))
?
-
EFAULT
:
arg1
;
kfree
(
indices
);
return
ret
;
}
case
BRCTL_ADD_BRIDGE
:
...
...
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