From eedb4bf9441ae3545a4ab74eac2d10fa57681355 Mon Sep 17 00:00:00 2001 From: Michael Walton Date: Tue, 12 Aug 2014 15:03:52 -0500 Subject: [PATCH] dynamic: Prevent oops due to inverted compile flag The logic on ENABLE_TASKELETS compiler flag was inverted causing an oops on normal dahdi_cfg of a dynamic span. Issue-id: https://issues.asterisk.org/jira/browse/DAHLIN-328 Signed-off-by: Russ Meyerriecks Acked-by: Shaun Ruffell --- drivers/dahdi/dahdi_dynamic.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/dahdi/dahdi_dynamic.c b/drivers/dahdi/dahdi_dynamic.c index 3ee1ad2..5be3b97 100644 --- a/drivers/dahdi/dahdi_dynamic.c +++ b/drivers/dahdi/dahdi_dynamic.c @@ -201,7 +201,9 @@ static void dahdi_dynamic_sendmessage(struct dahdi_dynamic *d) static void __dahdi_dynamic_run(void) { struct dahdi_dynamic *d; +#ifdef ENABLE_TASKLETS struct dahdi_dynamic_driver *drv; +#endif rcu_read_lock(); list_for_each_entry_rcu(d, &dspan_list, list) { @@ -211,6 +213,13 @@ static void __dahdi_dynamic_run(void) } #ifdef ENABLE_TASKLETS + list_for_each_entry_rcu(drv, &driver_list, list) { + /* Flush any traffic still pending in the driver */ + if (drv->flush) { + drv->flush(); + } + } +#else /* If tasklets are not enabled, the above section will be called in * interrupt context and the flushing of each driver will be called in a * separate tasklet that only handles that. This is necessary since some @@ -221,13 +230,6 @@ static void __dahdi_dynamic_run(void) * */ tasklet_hi_schedule(&dahdi_dynamic_flush_tlet); -#else - list_for_each_entry_rcu(drv, &driver_list, list) { - /* Flush any traffic still pending in the driver */ - if (drv->flush) { - drv->flush(); - } - } #endif rcu_read_unlock(); }