lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 10 Jun 2022 00:45:25 -0700
From:   Yihao Han <hanyihao@...o.com>
To:     Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Yihao Han <hanyihao@...o.com>
Subject: [PATCH] usb: phy: tahvo: Check before clk_disable() not needed

clk_disable() already checks the clk ptr using IS_ERR_OR_NULL(clk)
so there is no need to check it again before calling it.

Signed-off-by: Yihao Han <hanyihao@...o.com>
---
 drivers/usb/phy/phy-tahvo.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index f2d2cc586c5b..9cecc5444515 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -406,8 +406,7 @@ static int tahvo_usb_probe(struct platform_device *pdev)
 err_remove_phy:
 	usb_remove_phy(&tu->phy);
 err_disable_clk:
-	if (!IS_ERR(tu->ick))
-		clk_disable(tu->ick);
+	clk_disable(tu->ick);
 
 	return ret;
 }
@@ -418,8 +417,7 @@ static int tahvo_usb_remove(struct platform_device *pdev)
 
 	free_irq(tu->irq, tu);
 	usb_remove_phy(&tu->phy);
-	if (!IS_ERR(tu->ick))
-		clk_disable(tu->ick);
+	clk_disable(tu->ick);
 
 	return 0;
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ