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: <20240714050507.2505-1-sensor1010@163.com>
Date: Sat, 13 Jul 2024 22:05:07 -0700
From: 李哲 <sensor1010@....com>
To: gregkh@...uxfoundation.org,
	rafael@...nel.org
Cc: linux-kernel@...r.kernel.org,
	李哲 <sensor1010@....com>
Subject: [PATCH] driver:core:  NO need to determine whether the driver is asynchronous

When rescanning the device, there is no need to determine
whether the driver is asynchronous.

Signed-off-by: 李哲 <sensor1010@....com>
---
 drivers/base/dd.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 47351d98f6e1..41fd4b1b4779 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -915,7 +915,7 @@ static int __device_attach_driver(struct device_driver *drv, void *_data)
 {
 	struct device_attach_data *data = _data;
 	struct device *dev = data->dev;
-	bool async_allowed;
+	bool async_allowed = false;
 	int ret;
 
 	ret = driver_match_device(drv, dev);
@@ -936,12 +936,14 @@ static int __device_attach_driver(struct device_driver *drv, void *_data)
 		return ret;
 	} /* ret > 0 means positive match */
 
-	async_allowed = driver_allows_async_probing(drv);
+	if (data->check_async) {
+		async_allowed = driver_allows_async_probing(drv);
 
-	if (async_allowed)
-		data->have_async = true;
+		if (async_allowed)
+			data->have_async = true;
+	}
 
-	if (data->check_async && async_allowed != data->want_async)
+	if (async_allowed != data->want_async)
 		return 0;
 
 	/*
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ