diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index 81e5f9a70f22..e76c40bf29d0 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -113,6 +113,9 @@ size_t alloc_tag_top_users(struct codetag_bytes *tags, size_t count, bool can_sl struct codetag_bytes n; unsigned int i, nr = 0; + if (IS_ERR_OR_NULL(alloc_tag_cttype)) + return 0; + if (can_sleep) codetag_lock_module_list(alloc_tag_cttype, true); else if (!codetag_trylock_module_list(alloc_tag_cttype))