diff options
author | Michael Bestas <mkbestas@lineageos.org> | 2020-04-14 16:18:14 +0300 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-04-14 18:41:04 +0300 |
commit | 9eb199e06bc76fb2677052c3a171b2ab917c121d (patch) | |
tree | d92fe8bf4acb7ed72bb329b4191bc2bc7f222d73 /mm/memcontrol.c | |
parent | 268d6e9ab66bfd7a826050a9a651cdd6bca2f773 (diff) | |
parent | f9991115f079363d70ce91c37d850ec4a5e065a6 (diff) |
Merge branch 'android-4.4-p' of https://android.googlesource.com/kernel/common into lineage-17.1-caf-msm8998
This brings LA.UM.8.4.r1-05300-8x98.0 up to date with
https://android.googlesource.com/kernel/common/ android-4.4-p at commit:
f9991115f0793 Merge 4.4.219 into android-4.4-p
Conflicts:
drivers/clk/qcom/clk-rcg2.c
drivers/scsi/sd.c
drivers/usb/gadget/function/f_fs.c
drivers/usb/gadget/function/u_serial.c
Change-Id: Ifed3db0ddda828c1697e57e9f73c1b73354bebf7
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c27031b4683a..cb98a1889c8c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3480,7 +3480,7 @@ static void __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, struct mem_cgroup_thresholds *thresholds; struct mem_cgroup_threshold_ary *new; unsigned long usage; - int i, j, size; + int i, j, size, entries; mutex_lock(&memcg->thresholds_lock); @@ -3500,14 +3500,20 @@ static void __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, __mem_cgroup_threshold(memcg, type == _MEMSWAP); /* Calculate new number of threshold */ - size = 0; + size = entries = 0; for (i = 0; i < thresholds->primary->size; i++) { if (thresholds->primary->entries[i].eventfd != eventfd) size++; + else + entries++; } new = thresholds->spare; + /* If no items related to eventfd have been cleared, nothing to do */ + if (!entries) + goto unlock; + /* Set thresholds array to NULL if we don't have thresholds */ if (!size) { kfree(new); |