Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: linux-arm-msm@vger.kernel.org
Subject: [bug report] soc: qcom: smem: better track SMEM uninitialized state
Date: Fri, 21 Nov 2025 11:48:07 +0300	[thread overview]
Message-ID: <aSAnR3ECa04CoPqp@stanley.mountain> (raw)

Hello Christian Marangi,

Commit 7a94d5f31b54 ("soc: qcom: smem: better track SMEM
uninitialized state") from Oct 31, 2025 (linux-next), leads to the
following Smatch static checker warning:

	drivers/soc/qcom/smem.c:519 qcom_smem_alloc()
	warn: '__smem' can also be NULL

drivers/soc/qcom/smem.c
    509 int qcom_smem_alloc(unsigned host, unsigned item, size_t size)
    510 {
    511         struct smem_partition *part;
    512         unsigned long flags;
    513         int ret;
    514 
    515         if (IS_ERR(__smem))
    516                 return PTR_ERR(__smem);

We recently changed this from being NULL at the start to being -EPROBE_DEFER
but the qcom_smem_remove() function still sets it to NULL and the
qcom_smem_is_available() still expects it to be NULL at the start so it
needs to be updated as well.

    517 
    518         if (item < SMEM_ITEM_LAST_FIXED) {
--> 519                 dev_err(__smem->dev,
    520                         "Rejecting allocation of static entry %d\n", item);
    521                 return -EINVAL;
    522         }

regards,
dan carpenter

             reply	other threads:[~2025-11-21  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21  8:48 Dan Carpenter [this message]
2025-11-21  8:55 ` [bug report] soc: qcom: smem: better track SMEM uninitialized state Christian Marangi
2025-11-21  9:25   ` Konrad Dybcio
2025-11-21 10:37   ` Dan Carpenter

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=aSAnR3ECa04CoPqp@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=ansuelsmth@gmail.com \
    --cc=linux-arm-msm@vger.kernel.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