genksyms: refactor the return points in the for-loop in __add_symbol()
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 3 Jan 2025 07:30:41 +0000 (16:30 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Fri, 10 Jan 2025 14:01:22 +0000 (23:01 +0900)
commit2480f53f21b21eb24a33815d4623f54fdb30cf27
tree7fbbc164786ec2577b9098ed7eab31cfd0d7adb1
parentf034d186bf9e2857079815e5490e2810a1a287a6
genksyms: refactor the return points in the for-loop in __add_symbol()

free_list() must be called before returning from this for-loop.

Swap 'break' and the combination of free_list() and 'return'.

This reduces the code and minimizes the risk of introducing memory
leaks in future changes.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/genksyms/genksyms.c