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 (try_lock_obj(obj)) { // Add a function to try locking the object
6             memset((void *)((char *)kasan_reset_tag(obj) + s->offset),
7                    0, sizeof(void *));
8             unlock_obj(obj); // Unlock after use
9         }
10     }
11 }
