Commit c3e388964baa00d8c3960f23e8c8a1fb3966759e

Authored by Benjamin Thery
Committed by David S. Miller
1 parent 7f0f598a00

net: fix ip_mr_init() error path

Similarly to IPv6 ip6_mr_init() (fixed last week), the order of cleanup
operations in the error/exit section of ip_mr_init() is completely
inversed. It should be the other way around.
Also a del_timer() is missing in the error path.

I should have guessed last week that this same error existed in ipmr.c
too, as ip6mr.c is largely inspired by ipmr.c.

Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 5 additions and 4 deletions Side-by-side Diff

... ... @@ -1945,14 +1945,15 @@
1945 1945 goto proc_cache_fail;
1946 1946 #endif
1947 1947 return 0;
1948   -reg_notif_fail:
1949   - kmem_cache_destroy(mrt_cachep);
1950 1948 #ifdef CONFIG_PROC_FS
1951   -proc_vif_fail:
1952   - unregister_netdevice_notifier(&ip_mr_notifier);
1953 1949 proc_cache_fail:
1954 1950 proc_net_remove(&init_net, "ip_mr_vif");
  1951 +proc_vif_fail:
  1952 + unregister_netdevice_notifier(&ip_mr_notifier);
1955 1953 #endif
  1954 +reg_notif_fail:
  1955 + del_timer(&ipmr_expire_timer);
  1956 + kmem_cache_destroy(mrt_cachep);
1956 1957 return err;
1957 1958 }