From: Anastasia Belova <abelova@astralinux.ru>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Anastasia Belova <abelova@astralinux.ru>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Randy Dunlap <rdunlap@infradead.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Maxime Bizon <mbizon@freebox.fr>,
Ralf Baechle <ralf@linux-mips.org>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org, kernel test robot <lkp@intel.com>
Subject: [PATCH v2 2/2] MIPS: BCM63xx: Add check for NULL for clk in clk_enable
Date: Wed, 7 Dec 2022 17:28:24 +0300 [thread overview]
Message-ID: <20221207142824.8706-2-abelova@astralinux.ru> (raw)
In-Reply-To: <20221207142824.8706-1-abelova@astralinux.ru>
Errors from previous version of patch fixed.
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.")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
---
arch/mips/bcm63xx/clk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index 401140cf36d9..cf303d6e6693 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -362,7 +362,7 @@ static struct clk clk_periph = {
int clk_enable(struct clk *clk)
{
if (!clk)
- return;
+ return 0;
mutex_lock(&clocks_mutex);
clk_enable_unlocked(clk);
--
2.30.2
next prev parent reply other threads:[~2022-12-07 14:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 14:28 [PATCH v2 1/2] MIPS: BCM63xx: Add check for NULL for clk in clk_enable Anastasia Belova
2022-12-07 14:28 ` Anastasia Belova [this message]
2022-12-07 15:53 ` [lvc-project] [PATCH v2 2/2] " Alexey Khoroshilov
2022-12-07 18:23 ` Florian Fainelli
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=20221207142824.8706-2-abelova@astralinux.ru \
--to=abelova@astralinux.ru \
--cc=Jonathan.Cameron@huawei.com \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=lkp@intel.com \
--cc=lvc-project@linuxtesting.org \
--cc=mbizon@freebox.fr \
--cc=ralf@linux-mips.org \
--cc=rdunlap@infradead.org \
--cc=tsbogend@alpha.franken.de \
/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).