All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Nathan Chancellor <nathan@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Al Cooper <alcooperx@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Kamal Dasu <kdasu.kdev@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Cc: bcm-kernel-feedback-list@broadcom.com,
	Nick Desaulniers <ndesaulniers@google.com>,
	Tom Rix <trix@redhat.com>, Justin Stitt <jstitt007@gmail.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	llvm@lists.linux.dev, patches@lists.linux.dev,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] mmc: sdhci-brcmstb: Initialize base_clk to NULL in sdhci_brcmstb_probe()
Date: Wed, 8 Jun 2022 19:13:01 +0200	[thread overview]
Message-ID: <51542057-4b25-7897-b2a0-d5027af869ea@gmail.com> (raw)
In-Reply-To: <20220608152757.82529-1-nathan@kernel.org>



On 6/8/2022 5:27 PM, Nathan Chancellor wrote:
> Clang warns a few times along the lines of:
> 
>    drivers/mmc/host/sdhci-brcmstb.c:302:6: warning: variable 'base_clk' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
>            if (res)
>                ^~~
>    drivers/mmc/host/sdhci-brcmstb.c:376:24: note: uninitialized use occurs here
>            clk_disable_unprepare(base_clk);
>                                  ^~~~~~~~
> 
> base_clk is used in the error path before it is initialized. Initialize
> it to NULL, as clk_disable_unprepare() calls clk_disable() and
> clk_unprepare(), which both handle NULL pointers gracefully.
> 
> Fixes: 2cecaac1b21c ("mmc: sdhci-brcmstb: Add ability to increase max clock rate for 72116b0")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1650
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <f.fainelli@gmail.com>
To: Nathan Chancellor <nathan@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Al Cooper <alcooperx@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Kamal Dasu <kdasu.kdev@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Cc: bcm-kernel-feedback-list@broadcom.com,
	Nick Desaulniers <ndesaulniers@google.com>,
	Tom Rix <trix@redhat.com>, Justin Stitt <jstitt007@gmail.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	llvm@lists.linux.dev, patches@lists.linux.dev,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] mmc: sdhci-brcmstb: Initialize base_clk to NULL in sdhci_brcmstb_probe()
Date: Wed, 8 Jun 2022 19:13:01 +0200	[thread overview]
Message-ID: <51542057-4b25-7897-b2a0-d5027af869ea@gmail.com> (raw)
In-Reply-To: <20220608152757.82529-1-nathan@kernel.org>



On 6/8/2022 5:27 PM, Nathan Chancellor wrote:
> Clang warns a few times along the lines of:
> 
>    drivers/mmc/host/sdhci-brcmstb.c:302:6: warning: variable 'base_clk' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
>            if (res)
>                ^~~
>    drivers/mmc/host/sdhci-brcmstb.c:376:24: note: uninitialized use occurs here
>            clk_disable_unprepare(base_clk);
>                                  ^~~~~~~~
> 
> base_clk is used in the error path before it is initialized. Initialize
> it to NULL, as clk_disable_unprepare() calls clk_disable() and
> clk_unprepare(), which both handle NULL pointers gracefully.
> 
> Fixes: 2cecaac1b21c ("mmc: sdhci-brcmstb: Add ability to increase max clock rate for 72116b0")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1650
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-06-08 17:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08 15:27 [PATCH] mmc: sdhci-brcmstb: Initialize base_clk to NULL in sdhci_brcmstb_probe() Nathan Chancellor
2022-06-08 15:27 ` Nathan Chancellor
2022-06-08 17:13 ` Florian Fainelli [this message]
2022-06-08 17:13   ` Florian Fainelli
2022-06-13 10:27 ` Adrian Hunter
2022-06-13 10:27   ` Adrian Hunter
2022-06-15 17:32 ` Ulf Hansson
2022-06-15 17:32   ` Ulf Hansson

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=51542057-4b25-7897-b2a0-d5027af869ea@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dan.carpenter@oracle.com \
    --cc=jstitt007@gmail.com \
    --cc=kdasu.kdev@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=patches@lists.linux.dev \
    --cc=trix@redhat.com \
    --cc=ulf.hansson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.