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: <20241228165720.16552-1-goldside000@outlook.com>
Date: Sat, 28 Dec 2024 16:57:44 +0000
From: Steven Davis <goldside000@...look.com>
To: "johan@...nel.org" <johan@...nel.org>, "elder@...nel.org"
	<elder@...nel.org>, "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC: "greybus-dev@...ts.linaro.dev" <greybus-dev@...ts.linaro.dev>,
	"linux-staging@...ts.linux.dev" <linux-staging@...ts.linux.dev>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Steven Davis
	<goldside000@...look.com>
Subject: [PATCH] staging: greybus: Log driver_register() failure

Currently, if driver_register() fails, it just returns retval
and fails silently. This behavior may make the error more difficult
to debug, as the error is not logged.

Adding pr_err() here will log the error descriptively, along with
driver name and the value that retval returned. That way, the error
is not silent and the user can see what happened.

Signed-off-by: Steven Davis <goldside000@...look.com>
---
 drivers/staging/greybus/gbphy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/gbphy.c b/drivers/staging/greybus/gbphy.c
index 6adcad286..c6d1030b7 100644
--- a/drivers/staging/greybus/gbphy.c
+++ b/drivers/staging/greybus/gbphy.c
@@ -204,8 +204,10 @@ int gb_gbphy_register_driver(struct gbphy_driver *driver,
 	driver->driver.mod_name = mod_name;
 
 	retval = driver_register(&driver->driver);
-	if (retval)
+	if (retval) {
+		pr_err("failed to register driver %s: %d\n", driver->name, retval);
 		return retval;
+	}
 
 	pr_info("registered new driver %s\n", driver->name);
 	return 0;
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ