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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96bbc0d0f3c76b91752db07f0f5287e4@codeaurora.org>
Date:   Wed, 20 Feb 2019 10:39:04 +0800
From:   yuankuiz@...eaurora.org
To:     Luis Chamberlain <mcgrof@...nel.org>
Cc:     gregkh@...uxfoundation.org, rafael@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH v2] firmware: hardcode the debug message for -ENOENT

 From: John Zhao <yuankuiz@...eaurora.org>

When no file /path was found, the error code of -ENOENT
enumerated in errno-base.h, is returned. Stating clearly that
the file was not found is much more useful for debugging, So
let's be explicit about that.

Signed-off-by: John Zhao <yuankuiz@...eaurora.org>
---
  drivers/base/firmware_loader/main.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/base/firmware_loader/main.c 
b/drivers/base/firmware_loader/main.c
index 8e9213b..7eaaf5e 100644
--- a/drivers/base/firmware_loader/main.c
+++ b/drivers/base/firmware_loader/main.c
@@ -328,12 +328,12 @@ fw_get_filesystem_firmware(struct device *device, 
struct fw_priv *fw_priv)
  		rc = kernel_read_file_from_path(path, &fw_priv->data, &size,
  						msize, id);
  		if (rc) {
-			if (rc == -ENOENT)
-				dev_dbg(device, "loading %s failed with error %d\n",
-					 path, rc);
-			else
+			if (rc != -ENOENT)
  				dev_warn(device, "loading %s failed with error %d\n",
  					 path, rc);
+			else
+				dev_dbg(device, "loading %s failed for no such file or 
directory.\n",
+					 path);
  			continue;
  		}
  		dev_dbg(device, "direct-loading %s\n", fw_priv->fw_name);
-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ