]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/multipath_wrandom.c
Merge git://oss.sgi.com:8090/oss/git/xfs-2.6
[linux-2.6-omap-h63xx.git] / net / ipv4 / multipath_wrandom.c
index 10b23e1bece663bd8a9317f980b30ec0df7f0a11..d34a9fa608e0b88dec20adaa567100a5b63c4ee0 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/igmp.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
+#include <linux/module.h>
 #include <linux/mroute.h>
 #include <linux/init.h>
 #include <net/ip.h>
@@ -172,7 +173,7 @@ static void wrandom_select_route(const struct flowi *flp,
                    multipath_comparekeys(&rt->fl, flp)) {
                        struct multipath_candidate* mpc =
                                (struct multipath_candidate*)
-                               kmalloc(size_mpc, GFP_KERNEL);
+                               kmalloc(size_mpc, GFP_ATOMIC);
 
                        if (!mpc)
                                return;
@@ -206,16 +207,12 @@ static void wrandom_select_route(const struct flowi *flp,
                        decision = mpc->rt;
 
                last_power = mpc->power;
-               if (last_mpc)
-                       kfree(last_mpc);
-
+               kfree(last_mpc);
                last_mpc = mpc;
        }
 
-       if (last_mpc) {
-               /* concurrent __multipath_flush may lead to !last_mpc */
-               kfree(last_mpc);
-       }
+       /* concurrent __multipath_flush may lead to !last_mpc */
+       kfree(last_mpc);
 
        decision->u.dst.__use++;
        *rp = decision;
@@ -244,7 +241,7 @@ static void wrandom_set_nhinfo(__u32 network,
        if (!target_route) {
                const size_t size_rt = sizeof(struct multipath_route);
                target_route = (struct multipath_route *)
-                       kmalloc(size_rt, GFP_KERNEL);
+                       kmalloc(size_rt, GFP_ATOMIC);
 
                target_route->gw = nh->nh_gw;
                target_route->oif = nh->nh_oif;
@@ -265,7 +262,7 @@ static void wrandom_set_nhinfo(__u32 network,
        if (!target_dest) {
                const size_t size_dst = sizeof(struct multipath_dest);
                target_dest = (struct multipath_dest*)
-                       kmalloc(size_dst, GFP_KERNEL);
+                       kmalloc(size_dst, GFP_ATOMIC);
 
                target_dest->nh_info = nh;
                target_dest->network = network;
@@ -342,3 +339,4 @@ static void __exit wrandom_exit(void)
 
 module_init(wrandom_init);
 module_exit(wrandom_exit);
+MODULE_LICENSE("GPL");