Fix NULL ptr dereference causing kernel panic

When `service_stop_done()` is called with a `NULL` argument and no
dynamic services have been stopped, this regression is triggered.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2015-11-25 09:30:53 +01:00
parent d8188428ed
commit 3ea4be9343
+1 -1
View File
@@ -406,7 +406,7 @@ static int service_stop_done(svc_t *svc)
plugin_run_hooks(HOOK_SVC_RECONF); /* Reconfigure HW/VLANs/etc here */
/* Finish off by starting/reload modified/new services */
if (svc->state == SVC_RELOAD_STATE)
if (svc && svc->state == SVC_RELOAD_STATE)
service_start_dynamic();
}