From patchwork Wed Dec 7 14:28:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anastasia Belova X-Patchwork-Id: 30884 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp217306wrr; Wed, 7 Dec 2022 06:31:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf7/5uNmncKbqK/Ree6+fxFXj0G19/f4jopvqck3AP/S3JJRgXh5P52XrnU1TVMWQIs644/t X-Received: by 2002:a17:902:934b:b0:189:78db:12be with SMTP id g11-20020a170902934b00b0018978db12bemr52966760plp.8.1670423475285; Wed, 07 Dec 2022 06:31:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670423475; cv=none; d=google.com; s=arc-20160816; b=lU9p3DzF9QzcGvN2kaE0trls15HyhrYNzeNrg1WYbFyns9Cb8/HHKXW/U4YjvPz2Zj wIWOSUtaNUupeCcKbe4lq372PF9T3xeRaYmZaU0K40wlSqOn4KZyHdEiuimcnTXkVCJM usXbm/YBshHIFPFXL3SGgS/3aVGhIIartKYZV3iNtOxiGAypDhCEEEsu2BX66ybmP4Mf 5rBOwJI2YG0/5R39Q9MFR2g5yxy2FMGR/5X7iYyMeBpfYUfCLj2f15PGXjj34RjISkmx 9uq6QbreRV3X1VaW2Ai58sIRCR1QblMdpI87M4jQaQ1zSoFu8mhuVoRO4gh6mMxuN4y8 cP9A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=lbiYNrXTuNd7823tZZtkYVsZAaSEbj9/3161VSAbfFI=; b=xaIPW3yQY7qZB7OVYfCi1fSY9js0dguy409l3sm7hY7KbXVLkQNpobMEbItVA6A25V P4wXd6SgC6/tI6zJUT0agwL0Z/2N/JCc7B6diUydyZmOQxG1odRPrHuk7nShOXNrOLA2 mwPZ4DkPBf6R4vYjNHls3uGi4pU/UV7gZmnxTVxfgffcNJt3onj8aJsinmFR8cNsHm89 9OnbskoOtsrGZu6ApXnRxo1K+uwkKO6C9zHxMYm3wlV9TfsFOcHjvoz5115WGD3I0MJd 5u0f0oxM22GjbPzHi/c6C0KAap2oJroJbVJs+mhBV9RtN1VPWS9278Yxa08k8Ix9RAXQ Z0dw== 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 g8-20020a636b08000000b004768f1cd061si21002473pgc.374.2022.12.07.06.31.01; Wed, 07 Dec 2022 06:31:15 -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 S230345AbiLGO3R (ORCPT + 99 others); Wed, 7 Dec 2022 09:29:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230269AbiLGO2o (ORCPT ); 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 227EA56EC0; Wed, 7 Dec 2022 06:28:34 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 7390018643B9; Wed, 7 Dec 2022 17:28:32 +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 cMC_BiZcTg-y; Wed, 7 Dec 2022 17:28:32 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 2722D18643BE; Wed, 7 Dec 2022 17:28:32 +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 IfQygreVYS-r; Wed, 7 Dec 2022 17:28:32 +0300 (MSK) Received: from rbta-msk-lt-106062.astralinux.ru (unknown [10.177.20.20]) by mail.astralinux.ru (Postfix) with ESMTPSA id 8132D18643B9; Wed, 7 Dec 2022 17:28:31 +0300 (MSK) From: Anastasia Belova To: Thomas Bogendoerfer Cc: Anastasia Belova , Jonathan Cameron , Randy Dunlap , Florian Fainelli , Maxime Bizon , Ralf Baechle , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, kernel test robot 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 Message-Id: <20221207142824.8706-2-abelova@astralinux.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221207142824.8706-1-abelova@astralinux.ru> References: <20221207142824.8706-1-abelova@astralinux.ru> MIME-Version: 1.0 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: 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?1751565966353550206?= 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 Signed-off-by: Anastasia Belova --- 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);