]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: SDCA: functions: Fix confusing cleanup.h syntax
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Wed, 3 Dec 2025 16:12:40 +0000 (17:12 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 14 Dec 2025 10:34:46 +0000 (19:34 +0900)
commite39011184f23de3d04ca8e80b4df76c9047b4026
tree6c592333cb7461a06e02e24f7a593bef92efd4c6
parentbafd5cf04b2822bf3c865add7262d86e22b9588e
ASoC: SDCA: functions: Fix confusing cleanup.h syntax

Initializing automatic __free variables to NULL without need (e.g.
branches with different allocations), followed by actual allocation is
in contrary to explicit coding rules guiding cleanup.h:

"Given that the "__free(...) = NULL" pattern for variables defined at
the top of the function poses this potential interdependency problem the
recommendation is to always define and assign variables in one statement
and not group variable definitions at the top of the function when
__free() is used."

Code does not have a bug, but is less readable and uses discouraged
coding practice, so fix that by moving declaration to the place of
assignment.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20251203-asoc-wrong-cleanup-h-continued-v1-3-5142be4874fb@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sdca/sdca_functions.c