]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tee: qcomtee: call: Fix confusing cleanup.h syntax
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Mon, 8 Dec 2025 02:08:45 +0000 (03:08 +0100)
committerJens Wiklander <jens.wiklander@linaro.org>
Mon, 5 Jan 2026 09:21:09 +0000 (10:21 +0100)
commit4cc19518da40573fc1057c618a5b1acf8a941472
tree917bd4c64d383077cb63344097ca0ba70636a8d4
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
tee: qcomtee: call: 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: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/qcomtee/call.c