Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44C0BC43334 for ; Tue, 28 Jun 2022 02:23:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9453410F10B; Tue, 28 Jun 2022 02:23:40 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1627D10F10B for ; Tue, 28 Jun 2022 02:23:39 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9F461B81C14; Tue, 28 Jun 2022 02:23:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82387C341CA; Tue, 28 Jun 2022 02:23:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656383016; bh=xqO4vp3dlvUVLT+/DOlPHPKaxANGbZMXg9bHo6VLcOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PMmiUfEUQD88ZO9J4qlTOf7oA4AEaBcXB73hbMqo2/Lln5CtKVUfqnD9p5aaAi34f 2eCMYgfF2guD7uQsu1DikoXEjRbHAQZtM5ZG9pquQ3MArrwlmuVkwJComtNosFYrNb Dy96ahz4vp74EclJl/6+mOQEo4uMzyHdwNbsh2vI3G/hCLbZYQ3Sw80d7FZWUE5scp TxB6mMZXEpUzJ33F+yIm+hjysDGTtwyhD9yA5UqNuGzDZwB7XtjeRM0iV48GbJkQn8 NTrIupD3LqX6MnJnIsh19YJdF5dGS/sBP284EVZlLKIHvaN02uhWJHLo2qpemHO/sS t9dPzBWPWXJzA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 19/34] video: fbdev: simplefb: Check before clk_put() not needed Date: Mon, 27 Jun 2022 22:22:26 -0400 Message-Id: <20220628022241.595835-19-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220628022241.595835-1-sashal@kernel.org> References: <20220628022241.595835-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , linux-fbdev@vger.kernel.org, Yihao Han , Helge Deller , dri-devel@lists.freedesktop.org, Hans de Goede Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Yihao Han [ Upstream commit 5491424d17bdeb7b7852a59367858251783f8398 ] clk_put() already checks the clk ptr using !clk and IS_ERR() so there is no need to check it again before calling it. Signed-off-by: Yihao Han Reviewed-by: Hans de Goede Signed-off-by: Helge Deller Signed-off-by: Sasha Levin --- drivers/video/fbdev/simplefb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index 533a047d07a2..85cfda4f4cf8 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c @@ -225,8 +225,7 @@ static int simplefb_clocks_get(struct simplefb_par *par, if (IS_ERR(clock)) { if (PTR_ERR(clock) == -EPROBE_DEFER) { while (--i >= 0) { - if (par->clks[i]) - clk_put(par->clks[i]); + clk_put(par->clks[i]); } kfree(par->clks); return -EPROBE_DEFER; -- 2.35.1