]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fork: check charging success before zeroing stack
authorPasha Tatashin <pasha.tatashin@soleen.com>
Fri, 9 May 2025 06:29:28 +0000 (08:29 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 21 May 2025 17:48:23 +0000 (10:48 -0700)
commitd82893c52a64dd5698362ba1d7cb232a18839c87
tree0bf115e6fc119386b7b7bc7db753c13c7f36198b
parent90eb270d8eb46c2d54a13b938643fbc9cf56eaea
fork: check charging success before zeroing stack

No need to do zero cached stack if memcg charge fails, so move the
charging attempt before the memset operation.

[linus.walleij@linaro.org: rebased]
Link: https://lkml.kernel.org/r/20250509-fork-fixes-v3-3-e6c69dd356f2@linaro.org
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Link: https://lore.kernel.org/20240311164638.2015063-6-pasha.tatashin@soleen.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/fork.c