]> git.ipfire.org Git - thirdparty/linux.git/commit
platform/x86/amd: Use scope-based cleanup for wbrf_record()
authorZilin Guan <zilin@seu.edu.cn>
Tue, 6 Jan 2026 09:13:18 +0000 (09:13 +0000)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 26 Jan 2026 13:46:32 +0000 (15:46 +0200)
commit2ee832305a25657d7cfb577bc30d8c1d43bfb951
treed450eba553d6f91d0bc4ac893c9382306e7d959e
parent6343e06788e2edb822cd871e3e198a4ef69e3223
platform/x86/amd: Use scope-based cleanup for wbrf_record()

Simplify resource management in wbrf_record() by using the scope-based
cleanup helper __free(). This ensures that the tmp and obj are
automatically freed when they go out of scope, eliminating the need for
explicit error handling labels and manual freeing.

Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Suggested-by: Markus Elfring <Markus.Elfring@web.de>
Co-developed-by: Jianhao Xu <jianhao.xu@seu.edu.cn>
Signed-off-by: Jianhao Xu <jianhao.xu@seu.edu.cn>
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Link: https://patch.msgid.link/20260106091318.747019-2-zilin@seu.edu.cn
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/amd/wbrf.c