public inbox for op-tee@lists.trustedfirmware.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Cc: op-tee@lists.trustedfirmware.org
Subject: [bug report] tee: add Qualcomm TEE driver
Date: Thu, 18 Sep 2025 12:50:58 +0300	[thread overview]
Message-ID: <aMvWAiMky0k4nHlh@stanley.mountain> (raw)

Hello Amirreza Zarrabi,

Commit d6e290837e50 ("tee: add Qualcomm TEE driver") from Sep 11,
2025 (linux-next), leads to the following Smatch static checker
warning:

	drivers/tee/qcomtee/core.c:104 qcomtee_do_release_qtee_object()
	error: uninitialized symbol 'result'.

drivers/tee/qcomtee/core.c
    81 static void qcomtee_do_release_qtee_object(struct work_struct *work)
    82 {
    83         struct qcomtee_object *object;
    84         struct qcomtee *qcomtee;
    85         int ret, result;
    86 
    87         /* RELEASE does not require any argument. */
    88         struct qcomtee_arg args[] = { { .type = QCOMTEE_ARG_TYPE_INV } };
    89 
    90         object = container_of(work, struct qcomtee_object, work);
    91         qcomtee = tee_get_drvdata(object->info.qcomtee_async_ctx->teedev);
    92         /* Get the TEE context used for asynchronous operations. */
    93         qcomtee->oic.ctx = object->info.qcomtee_async_ctx;
    94 
    95         ret = qcomtee_object_do_invoke_internal(&qcomtee->oic, object,
    96                                                 QCOMTEE_MSG_OBJECT_OP_RELEASE,
    97                                                 args, &result);
    98 
    99         /* Is it safe to retry the release? */
    100         if (ret && ret != -ENODEV) {
    101                 queue_work(qcomtee->wq, &object->work);
    102         } else {
    103                 if (ret || result)
--> 104                         pr_err("%s release failed, ret = %d (%x)\n",
    105                                qcomtee_object_name(object), ret, result);
                                                                         ^^^^^^
result could be uninitialized if ret is non-zero.

    106                 qcomtee_qtee_object_free(object);
    107         }
    108 }

regards,
dan carpenter

             reply	other threads:[~2025-09-18  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18  9:50 Dan Carpenter [this message]
2025-11-10  9:00 ` [bug report] tee: add Qualcomm TEE driver Jens Wiklander
2025-11-10 19:50   ` Amirreza Zarrabi via OP-TEE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aMvWAiMky0k4nHlh@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=amirreza.zarrabi@oss.qualcomm.com \
    --cc=op-tee@lists.trustedfirmware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox