From: Dan Carpenter <error27@gmail.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Vladimir Zapolskiy <vz@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney@redhat.com>,
linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org
Subject: Re: [PATCH] clk: qcom: Return expected ENOMEM error on dynamic allocation failure
Date: Wed, 1 Jul 2026 13:01:24 +0300 [thread overview]
Message-ID: <akTldJur7GEgSkDD@stanley.mountain> (raw)
In-Reply-To: <39032914-3a66-43d9-885f-55f5d60da047@oss.qualcomm.com>
On Tue, Jun 30, 2026 at 10:50:13AM +0200, Konrad Dybcio wrote:
> On 6/29/26 6:21 PM, Vladimir Zapolskiy wrote:
> > If a dynamic memory allocation fails, the returned error code in clock
> > controller driver probe functions on a few legacy platforms should be
> > set to -ENOMEM instead of -EINVAL.
> >
> > Fixes: ee15faffef11 ("clk: qcom: common: Add API to register board clocks backwards compatibly")
> > Signed-off-by: Vladimir Zapolskiy <vz@kernel.org>
> > ---
>
> Hm, I'dve assumed that static checkers would be able to find this pattern
>
> +Dan do you still work on smatch nowadays? It doesn't seem to
> catch this one, but I think it'd be valuable to look for this pattern
> - AFAICS it only flags returning -1 instead of -ENOMEM but I can't
> seem to trigger it with a manual edit to this file and the following
> args:
>
> -p=kernel --pedantic --two-passes --assume-loops
>
>
> For the patch
>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
I'm re-working a bunch of Smatch internals right now. I've
fixed the -1 vs -ENOMEM warning, but it's affected by the re-work
so it's going to be a while before it hits mainline.
I can create a warning for returning -EINVAL or other error
codes instead of -ENOMEM.
regards,
dan carpenter
next prev parent reply other threads:[~2026-07-01 10:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 16:21 [PATCH] clk: qcom: Return expected ENOMEM error on dynamic allocation failure Vladimir Zapolskiy
2026-06-30 8:50 ` Konrad Dybcio
2026-07-01 10:01 ` Dan Carpenter [this message]
2026-07-01 10:37 ` Konrad Dybcio
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=akTldJur7GEgSkDD@stanley.mountain \
--to=error27@gmail.com \
--cc=andersson@kernel.org \
--cc=bmasney@redhat.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=vz@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