rcu: Check the return value of zalloc_cpumask_var()
authorPranith Kumar <bobby.prani@gmail.com>
Fri, 25 Jul 2014 23:02:07 +0000 (16:02 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 16 Sep 2014 17:08:00 +0000 (10:08 -0700)
This commit checks the return value of the zalloc_cpumask_var() used for
allocating cpumask for rcu_nocb_mask.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Paul Gortmaker <paul.gortmaker@windriver.com>
kernel/rcu/tree_plugin.h

index 06d077ccf8d5bd4141bfb07be95dfcab3068c182..105b0ce3d78f76b0752414f105d083aa47117746 100644 (file)
@@ -2440,7 +2440,10 @@ void __init rcu_init_nohz(void)
 #endif /* #if defined(CONFIG_NO_HZ_FULL) */
 
        if (!have_rcu_nocb_mask && need_rcu_nocb_mask) {
-               zalloc_cpumask_var(&rcu_nocb_mask, GFP_KERNEL);
+               if (!zalloc_cpumask_var(&rcu_nocb_mask, GFP_KERNEL)) {
+                       pr_info("rcu_nocb_mask allocation failed, callback offloading disabled.\n");
+                       return;
+               }
                have_rcu_nocb_mask = true;
        }
        if (!have_rcu_nocb_mask)