Message ID | 20221207142824.8706-1-abelova@astralinux.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp217176wrr; Wed, 7 Dec 2022 06:31:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf7hME3D/9ePRvNkqFn+VnYFt/Sxy+HZGjal+bD6XQtmvLYVeuVRuwCVurumrDa4Kcz5H7bZ X-Received: by 2002:a63:eb01:0:b0:477:5a8f:8037 with SMTP id t1-20020a63eb01000000b004775a8f8037mr64487419pgh.227.1670423463471; Wed, 07 Dec 2022 06:31:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670423463; cv=none; d=google.com; s=arc-20160816; b=jEzFdR28JUcFxr6sWG5pM+knoI213CXEfCk2jlWgsxZbuTQlfSc+KPo3sTUf6BSVKP nbc5H3wNUXvC5UUjS2JM/GkyH9pgfRd2y2RP4ks82h1i7K/2YlReFFDslTVQuwJxQBCW rJqelkVoVTJFZcdxciERfaGP2p504FFnglwTLmdjuy5v2rEhsKfdBcE4e0vspOxOOMWJ dB6uBVUoONPKByAEZe34bVkko6R+43nJrKHXwxWHH7jytDEySSnPvtcnuKCv6VdByvQx sSP5alw+kpN5IkvJMXl5D2t6OSTaIDSA5AL55dF7qE5syYJ72ZWcEWOb2EX1Lw9Mfe64 Vsag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=btd5BCK74T3HCrkYFswHCg2SlYH1HJVpAZMxqiNwUIs=; b=hDQ79bSz3qSpjkG04noPNTbXTYsiKRQ4wAtuqyFA9wEjsxkV3Bix1OqOpPdZuyKiei zusPFfHnqko8xjJJ9rfomXYgH50yhSm/pTX32hxscfRd7k816wnKAsiFxNSNheD1O+3A xyfKZzpxgNIcmGpLMxE6HDvK0fXG5jH8kwa9eW5XxUbJcbyj8qWx1TCa6HYqW+HCG/fw +etcawJgdPuZumVIgF4rJ3e/N8w8gGGJDHJJyQgonJXlmQ4V0ynD6k+caXDUa0/LH8v7 2aV9A71pXsQ5QI8Nc5GjfhLQr7BFUNUN8yez1BiAl1e1W9tg525aiX4sgnMG7MErfQkm dnww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f15-20020a170902ce8f00b0018862b71d11si22298558plg.381.2022.12.07.06.30.48; Wed, 07 Dec 2022 06:31:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230322AbiLGO3O (ORCPT <rfc822;foxyelen666@gmail.com> + 99 others); Wed, 7 Dec 2022 09:29:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230349AbiLGO2o (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 7 Dec 2022 09:28:44 -0500 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EBBE63C1; Wed, 7 Dec 2022 06:28:31 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 3F01F18641CD; Wed, 7 Dec 2022 17:28:27 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id GISrUkIlnUMT; Wed, 7 Dec 2022 17:28:27 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id E683418641D2; Wed, 7 Dec 2022 17:28:26 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kN8wJLelYFIx; Wed, 7 Dec 2022 17:28:26 +0300 (MSK) Received: from rbta-msk-lt-106062.astralinux.ru (unknown [10.177.20.20]) by mail.astralinux.ru (Postfix) with ESMTPSA id 3E16918641CD; Wed, 7 Dec 2022 17:28:26 +0300 (MSK) 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 Subject: [PATCH v2 1/2] MIPS: BCM63xx: Add check for NULL for clk in clk_enable Date: Wed, 7 Dec 2022 17:28:23 +0300 Message-Id: <20221207142824.8706-1-abelova@astralinux.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751565953617342415?= X-GMAIL-MSGID: =?utf-8?q?1751565953617342415?= |
Series |
[v2,1/2] MIPS: BCM63xx: Add check for NULL for clk in clk_enable
|
|
Commit Message
Anastasia Belova
Dec. 7, 2022, 2:28 p.m. UTC
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>
---
arch/mips/bcm63xx/clk.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c index 6e6756e8fa0a..401140cf36d9 100644 --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c @@ -361,6 +361,9 @@ static struct clk clk_periph = { */ int clk_enable(struct clk *clk) { + if (!clk) + return; + mutex_lock(&clocks_mutex); clk_enable_unlocked(clk); mutex_unlock(&clocks_mutex);