summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2008-05-12 14:02:22 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-13 08:02:25 -0700
commite662e1cfd434aa234b72fbc781f1d70211cb785b (patch)
treef733af13c469b185ba4b4eb192f2834936200e9b
parent67d7671036e6cae24ded112e079926d55ffe9580 (diff)
downloadblackbird-op-linux-e662e1cfd434aa234b72fbc781f1d70211cb785b.tar.gz
blackbird-op-linux-e662e1cfd434aa234b72fbc781f1d70211cb785b.zip
init: don't lose initcall return values
There is an ability to lose an initcall return value if it happened with irq disabled or imbalanced preemption (and if we debug initcall). Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--init/main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/init/main.c b/init/main.c
index ddada7acf363..f406fefa626c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -702,7 +702,6 @@ static void __init do_initcalls(void)
for (call = __initcall_start; call < __initcall_end; call++) {
ktime_t t0, t1, delta;
- char *msg = NULL;
char msgbuf[40];
int result;
@@ -724,22 +723,23 @@ static void __init do_initcalls(void)
(unsigned long long) delta.tv64 >> 20);
}
- if (result && result != -ENODEV && initcall_debug) {
- sprintf(msgbuf, "error code %d", result);
- msg = msgbuf;
- }
+ msgbuf[0] = 0;
+
+ if (result && result != -ENODEV && initcall_debug)
+ sprintf(msgbuf, "error code %d ", result);
+
if (preempt_count() != count) {
- msg = "preemption imbalance";
+ strncat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
preempt_count() = count;
}
if (irqs_disabled()) {
- msg = "disabled interrupts";
+ strncat(msgbuf, "disabled interrupts ", sizeof(msgbuf));
local_irq_enable();
}
- if (msg) {
+ if (msgbuf[0]) {
print_fn_descriptor_symbol(KERN_WARNING "initcall %s()",
(unsigned long) *call);
- printk(" returned with %s\n", msg);
+ printk(" returned with %s\n", msgbuf);
}
}
OpenPOWER on IntegriCloud