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>

authored by Benjamin Thery and committed by David S. Miller c3e38896 7f0f598a

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