* [bug report] soc: qcom: smem: better track SMEM uninitialized state
@ 2025-11-21 8:48 Dan Carpenter
2025-11-21 8:55 ` Christian Marangi
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2025-11-21 8:48 UTC (permalink / raw)
To: Christian Marangi; +Cc: linux-arm-msm
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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [bug report] soc: qcom: smem: better track SMEM uninitialized state
2025-11-21 8:48 [bug report] soc: qcom: smem: better track SMEM uninitialized state Dan Carpenter
@ 2025-11-21 8:55 ` Christian Marangi
2025-11-21 9:25 ` Konrad Dybcio
2025-11-21 10:37 ` Dan Carpenter
0 siblings, 2 replies; 4+ messages in thread
From: Christian Marangi @ 2025-11-21 8:55 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-arm-msm
On Fri, Nov 21, 2025 at 11:48:07AM +0300, Dan Carpenter wrote:
> 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 }
>
Hi,
I remember editing qcom_smem_is_available but probably it got lost when
amending the changes.
Creating a fix patch just now. Can you help me with what link I should
put in the Closes tag?
--
Ansuel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [bug report] soc: qcom: smem: better track SMEM uninitialized state
2025-11-21 8:55 ` Christian Marangi
@ 2025-11-21 9:25 ` Konrad Dybcio
2025-11-21 10:37 ` Dan Carpenter
1 sibling, 0 replies; 4+ messages in thread
From: Konrad Dybcio @ 2025-11-21 9:25 UTC (permalink / raw)
To: Christian Marangi, Dan Carpenter; +Cc: linux-arm-msm
On 11/21/25 9:55 AM, Christian Marangi wrote:
> On Fri, Nov 21, 2025 at 11:48:07AM +0300, Dan Carpenter wrote:
>> 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 }
>>
>
> Hi,
>
> I remember editing qcom_smem_is_available but probably it got lost when
> amending the changes.
>
> Creating a fix patch just now. Can you help me with what link I should
> put in the Closes tag?
All messages sent to any of the major lists are logged on lore.kernel.org
You can use the search box there (the main page will search *list names*
by default although there's a "search all inboxes button" button too)
Alternatively you can do lore.kernel.org/listname/msgid
where the msgid you should be able to get from your email client (if you
use Thunderbird there's an extension called 'Copy Message ID' that adds
a button for this in the reading view)
so, this one becomes:
https://lore.kernel.org/linux-arm-msm/aSAnR3ECa04CoPqp@stanley.mountain/
Konrad
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [bug report] soc: qcom: smem: better track SMEM uninitialized state
2025-11-21 8:55 ` Christian Marangi
2025-11-21 9:25 ` Konrad Dybcio
@ 2025-11-21 10:37 ` Dan Carpenter
1 sibling, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2025-11-21 10:37 UTC (permalink / raw)
To: Christian Marangi; +Cc: linux-arm-msm
On Fri, Nov 21, 2025 at 09:55:50AM +0100, Christian Marangi wrote:
> On Fri, Nov 21, 2025 at 11:48:07AM +0300, Dan Carpenter wrote:
> > 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 }
> >
>
> Hi,
>
> I remember editing qcom_smem_is_available but probably it got lost when
> amending the changes.
>
> Creating a fix patch just now. Can you help me with what link I should
> put in the Closes tag?
https://lore.kernel.org/all/aSAnR3ECa04CoPqp@stanley.mountain/
#!/usr/bin/perl
while (<>) {
if ($_ =~ /Message-ID: \<(.*)\>/) {
print "\n\n\n";
print "https://lore.kernel.org/all/$1\n";
print "\n\n\n";
}
}
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-21 10:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 8:48 [bug report] soc: qcom: smem: better track SMEM uninitialized state Dan Carpenter
2025-11-21 8:55 ` Christian Marangi
2025-11-21 9:25 ` Konrad Dybcio
2025-11-21 10:37 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.