c
1 static __always_inline void maybe_wipe_obj_freeptr(struct kmem_cache *s,
2                                                    void *obj)
3 {
4     if (unlikely(slab_want_init_on_free(s)) && obj) {
5         if (atomic_read(&obj->refcount) > 0) { // Assuming obj has a refcount field
6             memset((void *)((char *)kasan_reset_tag(obj) + s->offset),
7                    0, sizeof(void *));
8         }
9     }
10 }
