From ac1d53fa147d456e38527994e770da4870308ff0 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 1 Jul 2024 13:36:30 -0600 Subject: [PATCH] increment refcount in register but don't decrement in unregister --- src/provider.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/provider.c b/src/provider.c index 6aec815..cd662c0 100644 --- a/src/provider.c +++ b/src/provider.c @@ -237,10 +237,10 @@ dpusmph_init(struct module *module, const dpusm_pf_t *funcs) int dpusm_provider_register(dpusm_t *dpusm, struct module *module, const dpusm_pf_t *funcs) { /* make sure provider can't be unloaded before dpusm */ - /* if (!try_module_get(module)) { */ - /* printk("Error: Could not increment reference count of %s\n", module_name(module)); */ - /* return -ECANCELED; */ - /* } */ + if (!try_module_get(module)) { + printk("Error: Could not increment reference count of %s\n", module_name(module)); + return -ECANCELED; + } const int rc = dpusm_provider_sane_at_load(funcs); if (rc != DPUSM_OK) {