summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshikokuchuo <53399081+shikokuchuo@users.noreply.github.com>2025-02-17 10:02:15 +0000
committerGarrett D'Amore <garrett@damore.org>2025-03-16 18:03:11 -0700
commitd3fa55bbca3e0307f9f1279674be3b8cbe322704 (patch)
treef3cac752f343225b455d4e7e69a1ef55c95cfeef /src
parentea7f41042e2e3f91f943e9253439429ac72dc50e (diff)
downloadnng-d3fa55bbca3e0307f9f1279674be3b8cbe322704.tar.gz
nng-d3fa55bbca3e0307f9f1279674be3b8cbe322704.tar.bz2
nng-d3fa55bbca3e0307f9f1279674be3b8cbe322704.zip
fix aio_reap_list use of nni_aio_free() pointer to incorrect function type UBSAN warning
Diffstat (limited to 'src')
-rw-r--r--src/core/aio.c8
-rw-r--r--src/core/aio.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/core/aio.c b/src/core/aio.c
index 27ec6d9c..cab07acb 100644
--- a/src/core/aio.c
+++ b/src/core/aio.c
@@ -72,7 +72,7 @@ static int nni_aio_expire_q_cnt;
static nni_reap_list aio_reap_list = {
.rl_offset = offsetof(nni_aio, a_reap_node),
- .rl_func = (nni_cb) nni_aio_free,
+ .rl_func = nni_aio_free_cb,
};
static void nni_aio_expire_add(nni_aio *);
@@ -144,6 +144,12 @@ nni_aio_free(nni_aio *aio)
}
void
+nni_aio_free_cb(void *aio)
+{
+ nni_aio_free((nni_aio *) aio);
+}
+
+void
nni_aio_reap(nni_aio *aio)
{
if (aio != NULL) {
diff --git a/src/core/aio.h b/src/core/aio.h
index cae8610f..04fcafe3 100644
--- a/src/core/aio.h
+++ b/src/core/aio.h
@@ -44,6 +44,7 @@ extern int nni_aio_alloc(nni_aio **, nni_cb, void *arg);
// This must only be called on an object that was allocated
// with nni_aio_allocate.
extern void nni_aio_free(nni_aio *aio);
+extern void nni_aio_free_cb(void *aio);
// nni_aio_stop cancels any unfinished I/O, running completion callbacks,
// but also prevents any new operations from starting (nni_aio_start will