diff options
author | Damjan Marion <damarion@cisco.com> | 2018-04-05 21:32:29 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-04-09 16:06:20 +0000 |
commit | 72d2c4f3718ba5293e9e0fa8726406ee7d9f3940 (patch) | |
tree | 799a61d776b35e640bf2542148bcca946b926dca /src/vlib/unix/plugin.c | |
parent | f13a8787365300d757eca4624c8f8a6b7c49392b (diff) |
plugins: unload plugin if early init fails
Change-Id: I32f68e2ee8f5d32962acdefb0193583f71d342b3
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/unix/plugin.c')
-rw-r--r-- | src/vlib/unix/plugin.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vlib/unix/plugin.c b/src/vlib/unix/plugin.c index b4eb0b92fb4..61eaad471ff 100644 --- a/src/vlib/unix/plugin.c +++ b/src/vlib/unix/plugin.c @@ -155,7 +155,8 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi, int from_early_init) { /* This should never happen unless somebody chagnes registration macro */ clib_warning ("Missing plugin registration in plugin '%s'", pi->name); - os_exit (1); + dlclose (pi->handle); + goto error; } pi->reg = reg; @@ -175,7 +176,8 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi, int from_early_init) if (error) { clib_error_report (error); - os_exit (1); + dlclose (pi->handle); + goto error; } } else |