From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Anastasia Belova <abelova@astralinux.ru>
Cc: Randy Dunlap <rdunlap@infradead.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Ralf Baechle <ralf@linux-mips.org>,
Maxime Bizon <mbizon@freebox.fr>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org
Subject: Re: [PATCH v3] MIPS: BCM63xx: Add check for NULL for clk in clk_enable
Date: Fri, 9 Dec 2022 23:41:40 +0100 [thread overview]
Message-ID: <20221209224140.GA4928@alpha.franken.de> (raw)
In-Reply-To: <20221209100550.30470-1-abelova@astralinux.ru>
On Fri, Dec 09, 2022 at 01:05:50PM +0300, Anastasia Belova wrote:
> Check clk for NULL before calling clk_enable_unlocked where clk
> is dereferenced. There is such check in other implementations
> of clk_enable.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.")
> Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
> ---
> v2: Fix errors reported by kernel test robot <lkp@intel.com>.
> v3: Merge several patches into single one.
> arch/mips/bcm63xx/clk.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
> index 6e6756e8fa0a..86a6e2590866 100644
> --- a/arch/mips/bcm63xx/clk.c
> +++ b/arch/mips/bcm63xx/clk.c
> @@ -361,6 +361,8 @@ static struct clk clk_periph = {
> */
> int clk_enable(struct clk *clk)
> {
> + if (!clk)
> + return 0;
> mutex_lock(&clocks_mutex);
> clk_enable_unlocked(clk);
> mutex_unlock(&clocks_mutex);
> --
> 2.30.2
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
prev parent reply other threads:[~2022-12-09 22:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-09 10:05 [PATCH v3] MIPS: BCM63xx: Add check for NULL for clk in clk_enable Anastasia Belova
2022-12-09 16:39 ` Philippe Mathieu-Daudé
2022-12-09 17:07 ` Florian Fainelli
2022-12-09 22:41 ` Thomas Bogendoerfer [this message]
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=20221209224140.GA4928@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=Jonathan.Cameron@huawei.com \
--cc=abelova@astralinux.ru \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=mbizon@freebox.fr \
--cc=ralf@linux-mips.org \
--cc=rdunlap@infradead.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;
as well as URLs for NNTP newsgroup(s).