aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/compat/linuxkpi/common/src/linux_slab.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_slab.c b/sys/compat/linuxkpi/common/src/linux_slab.c
index 5dbd87b66d1a..e062f0535fda 100644
--- a/sys/compat/linuxkpi/common/src/linux_slab.c
+++ b/sys/compat/linuxkpi/common/src/linux_slab.c
@@ -193,6 +193,9 @@ lkpi_kmem_cache_free(struct linux_kmem_cache *c, void *m)
void
linux_kmem_cache_destroy(struct linux_kmem_cache *c)
{
+ if (c == NULL)
+ return;
+
if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) {
/* make sure all free callbacks have been called */
rcu_barrier();