Skip to content

Commit

Permalink
increment refcount in register but don't decrement in unregister
Browse files Browse the repository at this point in the history
  • Loading branch information
calccrypto committed Jul 1, 2024
1 parent d50b876 commit ac1d53f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ac1d53f

Please sign in to comment.