]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/stop_machine.c
stop_machine: fix error code handling on multiple cpus
[linux-2.6-omap-h63xx.git] / kernel / stop_machine.c
index 0e688c6a1a63d22d6b034de5af7b2891c1df2aad..8aff79d90ddccd3647cb884664920e45c609fe72 100644 (file)
@@ -66,6 +66,7 @@ static void stop_cpu(struct work_struct *unused)
        enum stopmachine_state curstate = STOPMACHINE_NONE;
        struct stop_machine_data *smdata = &idle;
        int cpu = smp_processor_id();
+       int err;
 
        if (!active_cpus) {
                if (cpu == first_cpu(cpu_online_map))
@@ -86,9 +87,11 @@ static void stop_cpu(struct work_struct *unused)
                                hard_irq_disable();
                                break;
                        case STOPMACHINE_RUN:
-                               /* |= allows error detection if functions on
-                                * multiple CPUs. */
-                               smdata->fnret |= smdata->fn(smdata->data);
+                               /* On multiple CPUs only a single error code
+                                * is needed to tell that something failed. */
+                               err = smdata->fn(smdata->data);
+                               if (err)
+                                       smdata->fnret = err;
                                break;
                        default:
                                break;