All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: tegra: Drop !provider check in tegra210_clk_emc_set_rate()
@ 2020-09-22 19:16 Stephen Boyd
  2020-09-23  8:23 ` Thierry Reding
  2020-09-23 23:59 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Boyd @ 2020-09-22 19:16 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-kernel, linux-clk, Joseph Lo, Thierry Reding

The provider variable is already dereferenced earlier in this function.
Drop the check for NULL as it is impossible.

Found with smatch

drivers/clk/tegra/clk-tegra210-emc.c:131 tegra210_clk_emc_set_rate() warn: variable dereferenced before check 'provider' (see line 124)

Cc: Joseph Lo <josephl@nvidia.com>
Cc: Thierry Reding <treding@nvidia.com>
Fixes: 0ac65fc946d3 ("clk: tegra: Implement Tegra210 EMC clock")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/tegra/clk-tegra210-emc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/tegra/clk-tegra210-emc.c b/drivers/clk/tegra/clk-tegra210-emc.c
index 352a2c3fc374..971c919b2994 100644
--- a/drivers/clk/tegra/clk-tegra210-emc.c
+++ b/drivers/clk/tegra/clk-tegra210-emc.c
@@ -126,7 +126,7 @@ static int tegra210_clk_emc_set_rate(struct clk_hw *hw, unsigned long rate,
 	unsigned int i;
 	int err;
 
-	if (!provider || !provider->configs || provider->num_configs == 0)
+	if (!provider->configs || provider->num_configs == 0)
 		return -EINVAL;
 
 	for (i = 0; i < provider->num_configs; i++) {

base-commit: 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5
-- 
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: tegra: Drop !provider check in tegra210_clk_emc_set_rate()
  2020-09-22 19:16 [PATCH] clk: tegra: Drop !provider check in tegra210_clk_emc_set_rate() Stephen Boyd
@ 2020-09-23  8:23 ` Thierry Reding
  2020-09-23 23:59 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2020-09-23  8:23 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Michael Turquette, linux-kernel, linux-clk, Joseph Lo

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

On Tue, Sep 22, 2020 at 12:16:41PM -0700, Stephen Boyd wrote:
> The provider variable is already dereferenced earlier in this function.
> Drop the check for NULL as it is impossible.
> 
> Found with smatch
> 
> drivers/clk/tegra/clk-tegra210-emc.c:131 tegra210_clk_emc_set_rate() warn: variable dereferenced before check 'provider' (see line 124)
> 
> Cc: Joseph Lo <josephl@nvidia.com>
> Cc: Thierry Reding <treding@nvidia.com>
> Fixes: 0ac65fc946d3 ("clk: tegra: Implement Tegra210 EMC clock")
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---
>  drivers/clk/tegra/clk-tegra210-emc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: tegra: Drop !provider check in tegra210_clk_emc_set_rate()
  2020-09-22 19:16 [PATCH] clk: tegra: Drop !provider check in tegra210_clk_emc_set_rate() Stephen Boyd
  2020-09-23  8:23 ` Thierry Reding
@ 2020-09-23 23:59 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2020-09-23 23:59 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-kernel, linux-clk, Joseph Lo, Thierry Reding

Quoting Stephen Boyd (2020-09-22 12:16:41)
> The provider variable is already dereferenced earlier in this function.
> Drop the check for NULL as it is impossible.
> 
> Found with smatch
> 
> drivers/clk/tegra/clk-tegra210-emc.c:131 tegra210_clk_emc_set_rate() warn: variable dereferenced before check 'provider' (see line 124)
> 
> Cc: Joseph Lo <josephl@nvidia.com>
> Cc: Thierry Reding <treding@nvidia.com>
> Fixes: 0ac65fc946d3 ("clk: tegra: Implement Tegra210 EMC clock")
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-23 23:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 19:16 [PATCH] clk: tegra: Drop !provider check in tegra210_clk_emc_set_rate() Stephen Boyd
2020-09-23  8:23 ` Thierry Reding
2020-09-23 23:59 ` Stephen Boyd

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.