Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7caf333c authored by Jiang Biao's avatar Jiang Biao Committed by Gagan Malvi
Browse files

mbcache: make sure c_entry_count is not decremented past zero



Change-Id: I86faa14a18ad7a1c1b9d790eee79cc54660e628a
Signed-off-by: default avatarJiang Biao <jiang.biao2@zte.com.cn>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
CC: Eric Biggers <ebiggers@google.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Jan Kara <jack@suse.cz>
parent c29704ed
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -238,6 +238,8 @@ void mb_cache_entry_delete(struct mb_cache *cache, u32 key, u64 value)
			spin_lock(&cache->c_list_lock);
			if (!list_empty(&entry->e_list)) {
				list_del_init(&entry->e_list);
				if (!WARN_ONCE(cache->c_entry_count == 0,
		"mbcache: attempt to decrement c_entry_count past zero"))
					cache->c_entry_count--;
				atomic_dec(&entry->e_refcnt);
			}