make sure that diag doesn't call hotplug from interrupt context
authorFelix Fietkau <nbd@openwrt.org>
Fri, 3 Nov 2006 11:56:38 +0000 (11:56 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 3 Nov 2006 11:56:38 +0000 (11:56 +0000)
SVN-Revision: 5417

openwrt/target/linux/package/diag/src/diag.c

index fdbd3ca762caa0c7b0bb5a21e0dde2308a79de42..bb5828bdae2fcdd027746ca4cdfe1adc7ff3c982 100644 (file)
@@ -666,6 +666,11 @@ struct event_t {
 
 static void hotplug_button(struct event_t *event)
 {
+       /* can't do it from interrupt context, reschedule */
+       if (in_interrupt()) {
+               schedule_task(&event->tq);
+               return;
+       }
        call_usermodehelper (event->argv[0], event->argv, event->envp);
        kfree(event);
 }