From c1342d934b2d8b09bbd3cebe271809665b16f177 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 13 Feb 2023 12:34:28 +0100 Subject: [PATCH 1/2] nl80211: add missing ucv_get() calls Arguments stored in the registry need an extra reference Signed-off-by: Felix Fietkau --- lib/nl80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nl80211.c b/lib/nl80211.c index e2c0c070..90b50e68 100644 --- a/lib/nl80211.c +++ b/lib/nl80211.c @@ -2514,7 +2514,7 @@ uc_nl_listener(uc_vm_t *vm, size_t nargs) break; } - ucv_array_set(listener_registry, i + 1, cb_func); + ucv_array_set(listener_registry, i + 1, ucv_get(cb_func)); l = xalloc(sizeof(*l)); l->index = i; if (!uc_nl_fill_cmds(l->cmds, cmds)) { @@ -2524,7 +2524,7 @@ uc_nl_listener(uc_vm_t *vm, size_t nargs) } rv = uc_resource_new(listener_type, l); - ucv_array_set(listener_registry, i, rv); + ucv_array_set(listener_registry, i, ucv_get(rv)); listener_vm = vm; return rv; From 9022b270683abf66332595bf9cb5a68e251d5c7b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 13 Feb 2023 12:35:08 +0100 Subject: [PATCH 2/2] rtnl: add missing ucv_get() calls Arguments stored in the registry need an extra reference Signed-off-by: Felix Fietkau --- lib/rtnl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rtnl.c b/lib/rtnl.c index 6a9144e2..26e7f565 100644 --- a/lib/rtnl.c +++ b/lib/rtnl.c @@ -3704,7 +3704,7 @@ uc_nl_listener(uc_vm_t *vm, size_t nargs) break; } - ucv_array_set(listener_registry, i + 1, cb_func); + ucv_array_set(listener_registry, i + 1, ucv_get(cb_func)); l = xalloc(sizeof(*l)); l->index = i; if (!uc_nl_fill_cmds(l->cmds, cmds)) { @@ -3714,7 +3714,7 @@ uc_nl_listener(uc_vm_t *vm, size_t nargs) } rv = uc_resource_new(listener_type, l); - ucv_array_set(listener_registry, i, rv); + ucv_array_set(listener_registry, i, ucv_get(rv)); listener_vm = vm; return rv;