]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tee: qcomtee: initialize result before use in release worker
authorAmirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Fri, 14 Nov 2025 03:38:42 +0000 (19:38 -0800)
committerJens Wiklander <jens.wiklander@linaro.org>
Mon, 17 Nov 2025 09:19:29 +0000 (10:19 +0100)
Initialize result to 0 so the error path doesn't read it
uninitialized when the invoke fails. Fixes a Smatch warning.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/op-tee/7c1e0de2-7d42-4c6b-92fe-0e4fe5d650b5@oss.qualcomm.com/
Fixes: d6e290837e50 ("tee: add Qualcomm TEE driver")
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/qcomtee/core.c

index 783acc59cfa9d222bd81518d14766be6aff290a0..5b8d74d007588e0cc846ef0ffa04c2fe911e5935 100644 (file)
@@ -82,7 +82,7 @@ static void qcomtee_do_release_qtee_object(struct work_struct *work)
 {
        struct qcomtee_object *object;
        struct qcomtee *qcomtee;
-       int ret, result;
+       int ret, result = 0;
 
        /* RELEASE does not require any argument. */
        struct qcomtee_arg args[] = { { .type = QCOMTEE_ARG_TYPE_INV } };