summaryrefslogtreecommitdiff
path: root/kernel/debug/debug_core.c
diff options
context:
space:
mode:
authorNaveen Kumar Chaudhary <naveen.osdev@gmail.com>2026-06-17 07:19:32 +0530
committerDaniel Thompson <daniel@riscstar.com>2026-10-28 16:55:39 +0000
commit22d59ccad2935b7dea7f818793b739343de433a8 (patch)
tree3f4d6cb15dc406a3f244c19d712cbb2cefe78bbe /kernel/debug/debug_core.c
parent24a19b953e2a3d0ea5a8c4951a0ab8f32720c907 (diff)
downloadlinux-22d59ccad2935b7dea7f818793b739343de433a8.tar.gz
linux-22d59ccad2935b7dea7f818793b739343de433a8.zip
kdb: fix memory leak in kdb_setenv() when environment is full
When kdb_setenv() fails to find a free slot in __env[], the function returns KDB_ENVFULL without freeing the previously allocated string buffer 'ep', leaking memory on every failed call. Add the missing kfree(ep) before returning KDB_ENVFULL. Fixes: a30d4ff8193e ("kdb: remove usage of static environment buffer") Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/mbwhul34esbxkdbmlbjaquv5lgyzznn6pdapohry3lsiidbz6n@zucvm5os363q Signed-off-by: Daniel Thompson <daniel@riscstar.com>
Diffstat (limited to 'kernel/debug/debug_core.c')
0 files changed, 0 insertions, 0 deletions