Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Fix: handle NULL case in spl_kmem_free_track() #567

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions module/spl/spl-kmem.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ spl_kmem_free_track(const void *ptr, size_t size)
{
kmem_debug_t *dptr;

/* Ignore NULL pointer since we haven't tracked it at all*/
if (ptr == NULL)
return;

/* Must exist in hash due to kmem_alloc() */
dptr = kmem_del_init(&kmem_lock, kmem_table, KMEM_HASH_BITS, ptr);
ASSERT3P(dptr, !=, NULL);
Expand Down