From: Anton Vorontsov Date: Wed, 21 Mar 2012 23:34:26 +0000 (-0700) Subject: mm/memcontrol.c: remove redundant BUG_ON() in mem_cgroup_usage_unregister_event() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=45f3e385b7a639c633d7a4b1e863c2d52b918258;p=openwrt%2Fstaging%2Fblogic.git mm/memcontrol.c: remove redundant BUG_ON() in mem_cgroup_usage_unregister_event() In the following code: if (type == _MEM) thresholds = &memcg->thresholds; else if (type == _MEMSWAP) thresholds = &memcg->memsw_thresholds; else BUG(); BUG_ON(!thresholds); The BUG_ON() seems redundant. Signed-off-by: Anton Vorontsov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c200875072f7..4dc9709eff31 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4467,12 +4467,6 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp, else BUG(); - /* - * Something went wrong if we trying to unregister a threshold - * if we don't have thresholds - */ - BUG_ON(!thresholds); - if (!thresholds->primary) goto unlock;