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
61c5652a
Commit
61c5652a
authored
Jul 20, 2003
by
Kambo Lohan
Committed by
David S. Miller
Jul 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Fix hang/memleak in pktgen.
parent
03eb6d11
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
net/core/pktgen.c
net/core/pktgen.c
+13
-5
No files found.
net/core/pktgen.c
View file @
61c5652a
...
@@ -47,6 +47,9 @@
...
@@ -47,6 +47,9 @@
* Also moved to /proc/net/pktgen/
* Also moved to /proc/net/pktgen/
* --ro
* --ro
*
*
* Fix refcount off by one if first packet fails, potential null deref,
* memleak 030710- KJP
*
* See Documentation/networking/pktgen.txt for how to use this.
* See Documentation/networking/pktgen.txt for how to use this.
*/
*/
...
@@ -85,9 +88,9 @@
...
@@ -85,9 +88,9 @@
#define cycles() ((u32)get_cycles())
#define cycles() ((u32)get_cycles())
#define VERSION "pktgen version 1.2"
#define VERSION "pktgen version 1.2
.1
"
static
char
version
[]
__initdata
=
static
char
version
[]
__initdata
=
"pktgen.c: v1.2: Packet Generator for packet performance testing.
\n
"
;
"pktgen.c: v1.2
.1
: Packet Generator for packet performance testing.
\n
"
;
/* Used to help with determining the pkts on receive */
/* Used to help with determining the pkts on receive */
...
@@ -611,12 +614,11 @@ static void inject(struct pktgen_info* info)
...
@@ -611,12 +614,11 @@ static void inject(struct pktgen_info* info)
kfree_skb
(
skb
);
kfree_skb
(
skb
);
skb
=
fill_packet
(
odev
,
info
);
skb
=
fill_packet
(
odev
,
info
);
if
(
skb
==
NULL
)
{
if
(
skb
==
NULL
)
{
break
;
goto
out_reldev
;
}
}
fp
++
;
fp
++
;
fp_tmp
=
0
;
/* reset counter */
fp_tmp
=
0
;
/* reset counter */
}
}
atomic_inc
(
&
skb
->
users
);
}
}
nr_frags
=
skb_shinfo
(
skb
)
->
nr_frags
;
nr_frags
=
skb_shinfo
(
skb
)
->
nr_frags
;
...
@@ -624,7 +626,11 @@ static void inject(struct pktgen_info* info)
...
@@ -624,7 +626,11 @@ static void inject(struct pktgen_info* info)
spin_lock_bh
(
&
odev
->
xmit_lock
);
spin_lock_bh
(
&
odev
->
xmit_lock
);
if
(
!
netif_queue_stopped
(
odev
))
{
if
(
!
netif_queue_stopped
(
odev
))
{
atomic_inc
(
&
skb
->
users
);
if
(
odev
->
hard_start_xmit
(
skb
,
odev
))
{
if
(
odev
->
hard_start_xmit
(
skb
,
odev
))
{
atomic_dec
(
&
skb
->
users
);
if
(
net_ratelimit
())
{
if
(
net_ratelimit
())
{
printk
(
KERN_INFO
"Hard xmit error
\n
"
);
printk
(
KERN_INFO
"Hard xmit error
\n
"
);
}
}
...
@@ -730,6 +736,8 @@ static void inject(struct pktgen_info* info)
...
@@ -730,6 +736,8 @@ static void inject(struct pktgen_info* info)
);
);
}
}
kfree_skb
(
skb
);
out_reldev:
out_reldev:
if
(
odev
)
{
if
(
odev
)
{
dev_put
(
odev
);
dev_put
(
odev
);
...
...
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