Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247973
b: refs/heads/master
c: ce14f89
h: refs/heads/master
i:
  247971: 6b9db5f
v: v3
  • Loading branch information
WANG Cong authored and David S. Miller committed May 23, 2011
1 parent 7348c9d commit ba5725c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 68d5ac2ed6180567407e4187e206df3ba6466373
refs/heads/master: ce14f8946a294ffa741ec29558a1c7e455cecd3b
19 changes: 12 additions & 7 deletions trunk/net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -3707,6 +3707,7 @@ static int __init pg_init(void)
{
int cpu;
struct proc_dir_entry *pe;
int ret = 0;

pr_info("%s", version);

Expand All @@ -3717,11 +3718,10 @@ static int __init pg_init(void)
pe = proc_create(PGCTRL, 0600, pg_proc_dir, &pktgen_fops);
if (pe == NULL) {
pr_err("ERROR: cannot create %s procfs entry\n", PGCTRL);
proc_net_remove(&init_net, PG_PROC_DIR);
return -EINVAL;
ret = -EINVAL;
goto remove_dir;
}

/* Register us to receive netdevice events */
register_netdevice_notifier(&pktgen_notifier_block);

for_each_online_cpu(cpu) {
Expand All @@ -3735,13 +3735,18 @@ static int __init pg_init(void)

if (list_empty(&pktgen_threads)) {
pr_err("ERROR: Initialization failed for all threads\n");
unregister_netdevice_notifier(&pktgen_notifier_block);
remove_proc_entry(PGCTRL, pg_proc_dir);
proc_net_remove(&init_net, PG_PROC_DIR);
return -ENODEV;
ret = -ENODEV;
goto unregister;
}

return 0;

unregister:
unregister_netdevice_notifier(&pktgen_notifier_block);
remove_proc_entry(PGCTRL, pg_proc_dir);
remove_dir:
proc_net_remove(&init_net, PG_PROC_DIR);
return ret;
}

static void __exit pg_cleanup(void)
Expand Down

0 comments on commit ba5725c

Please sign in to comment.