From: Frederic Weisbecker <fweisbec@xxxxxxxxx> So that callers of res_counter_charge() don't have to create and pass this pointer even if they aren't interested in it. Signed-off-by: Frederic Weisbecker <fweisbec@xxxxxxxxx> Cc: Paul Menage <paul@xxxxxxxxxxxxxx> Cc: Li Zefan <lizf@xxxxxxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Aditya Kali <adityakali@xxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Tim Hockin <thockin@xxxxxxxxxx> Cc: Tejun Heo <htejun@xxxxxxxxx> Cc: Containers <containers@xxxxxxxxxxxxxxxxxxxxxxxxxx> Cc: Glauber Costa <glommer@xxxxxxxxx> Cc: Cgroups <cgroups@xxxxxxxxxxxxxxx> Cc: Daniel J Walsh <dwalsh@xxxxxxxxxx> Cc: "Daniel P. Berrange" <berrange@xxxxxxxxxx> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: Max Kellermann <mk@xxxxxxxxxx> Cc: Mandeep Singh Baines <msb@xxxxxxxxxxxx> Acked-by: Kirill A. Shutemov <kirill@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/res_counter.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/res_counter.c b/kernel/res_counter.c index 8c16224..ece24f7 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c @@ -49,7 +49,8 @@ static int __res_counter_charge_until(struct res_counter *counter, struct res_counter *c, *u; r = ret = 0; - *limit_fail_at = NULL; + if (limit_fail_at) + *limit_fail_at = NULL; local_irq_save(flags); for (c = counter; c != top; c = c->parent) { spin_lock(&c->lock); @@ -57,7 +58,8 @@ static int __res_counter_charge_until(struct res_counter *counter, spin_unlock(&c->lock); if (r < 0 && !ret) { ret = r; - *limit_fail_at = c; + if (limit_fail_at) + *limit_fail_at = c; if (!force) break; } -- 1.8.3.1 _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/containers