mirror of
https://github.com/opnsense/src.git
synced 2026-05-25 02:35:01 -04:00
linuxkpi: Handle a NULL cache pointer in kmem_cache_destroy()
This is compatible with Linux, and some driver error paths depend on it.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
(cherry picked from commit a76de17715)
This commit is contained in:
parent
16dfe02e38
commit
e49d57eecc
1 changed files with 3 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue