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]
Message-Id: <20230430140129.112081-1-sensor1010@163.com>
Date:   Sun, 30 Apr 2023 22:01:29 +0800
From:   Lizhe <sensor1010@....com>
To:     linus.walleij@...aro.org, orsonzhai@...il.com,
        baolin.wang@...ux.alibaba.com, zhang.lyra@...il.com,
        andriy.shevchenko@...ux.intel.com
Cc:     linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        Lizhe <sensor1010@....com>
Subject: [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists

to check if the pinctrl_dev still exists before calling
pinctrl_unregister().

Signed-off-by: Lizhe <sensor1010@....com>
---
 drivers/pinctrl/sprd/pinctrl-sprd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c
index ca9659f4e4b1..52089e34435c 100644
--- a/drivers/pinctrl/sprd/pinctrl-sprd.c
+++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
@@ -1114,8 +1114,10 @@ EXPORT_SYMBOL_GPL(sprd_pinctrl_core_probe);
 int sprd_pinctrl_remove(struct platform_device *pdev)
 {
 	struct sprd_pinctrl *sprd_pctl = platform_get_drvdata(pdev);
+	
+	if (sprd_pctl->pctl)
+		pinctrl_unregister(sprd_pctl->pctl);
 
-	pinctrl_unregister(sprd_pctl->pctl);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(sprd_pinctrl_remove);
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ