From patchwork Tue Sep 22 19:16:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11792991 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4BBD81668 for ; Tue, 22 Sep 2020 19:16:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 292B823600 for ; Tue, 22 Sep 2020 19:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600802203; bh=xFAegshdal4oOFaZe0xOh2NNgkqPJPvZzLl0b11jFcw=; h=From:To:Cc:Subject:Date:List-ID:From; b=l9GyhgUfCahvCz5oCMWfkmH7cAOFFiBVhhKVIqikiAC/BpURqC77UfLSbGe+PDUd4 /EjLQ/SNets1jNDZE0hiVxTFToDS1OxEmhdAABrl3rGDJ6xPSewjTziUikXX5zfEoZ 6cAykoGUY5mvuZc7jIJldS6EjRfeSTxtgALU1zNA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726676AbgIVTQm (ORCPT ); Tue, 22 Sep 2020 15:16:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:58256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbgIVTQm (ORCPT ); Tue, 22 Sep 2020 15:16:42 -0400 Received: from mail.kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 34713206FC; Tue, 22 Sep 2020 19:16:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600802202; bh=xFAegshdal4oOFaZe0xOh2NNgkqPJPvZzLl0b11jFcw=; h=From:To:Cc:Subject:Date:From; b=sPqHsK5xTBVlrFS5V8D8Wi7xnOOszj7cfZKZAUpMFKFHJYJO+CoJxpfvQJ2l44+W4 HktAjslwLIrurrpF1cgwjH6Ut/AVl+/sN3o0E/WjGTL3d8OCtxPV7OGXZfrrm6zTWc BWYJPnWpg2oYkKk9Lb/DRhYboZ0my/m5MGUmhEpw= From: Stephen Boyd To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Joseph Lo , Thierry Reding Subject: [PATCH] clk: tegra: Drop !provider check in tegra210_clk_emc_set_rate() Date: Tue, 22 Sep 2020 12:16:41 -0700 Message-Id: <20200922191641.2305144-1-sboyd@kernel.org> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org 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 Cc: Thierry Reding Fixes: 0ac65fc946d3 ("clk: tegra: Implement Tegra210 EMC clock") Signed-off-by: Stephen Boyd Acked-by: Thierry Reding --- drivers/clk/tegra/clk-tegra210-emc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5 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++) {