Skip to contentSkip to conversation

cifs: Fix a debug message

PATCH Applied Dan Carpenter 2 participants 2 messages Jan 5, 2019 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: Fix a debug message

This debug message was never shown because it was checking for NULL returns but extract_hostname() returns error pointers.

Fixes 93d5cb517db3 ("cifs: Add support for failover in cifs_reconnect()")
---
 fs/cifs/connect.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
fs/cifs/connect.c +4 -3
index f66529679ca2..683310f26171 100644
@@ -433,9 +433,10 @@ static void reconn_inval_dfs_target(struct TCP_Server_Info *server,
 	kfree(server->hostname);
 
 	server->hostname = extract_hostname(name);
-	if (!server->hostname) {
-		cifs_dbg(FYI, "%s: failed to extract hostname from target: %d\n",
-			 __func__, -ENOMEM);
+	if (IS_ERR(server->hostname)) {
+		cifs_dbg(FYI,
+			 "%s: failed to extract hostname from target: %ld\n",
+			 __func__, PTR_ERR(server->hostname));
 	}
 }
 
Signature · 1 line
2.17.1
Applied
#1 lore raw

merged into cifs-2.6.git for-next

thx

Quoted 31 lines · Dan Carpenter

This debug message was never shown because it was checking for NULL returns but extract_hostname() returns error pointers.

Fixes 93d5cb517db3 ("cifs: Add support for failover in cifs_reconnect()")
---
 fs/cifs/connect.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
fs/cifs/connect.c +4 -4
index f66529679ca2..683310f26171 100644
@@ -433,9 +433,10 @@ static void reconn_inval_dfs_target(struct TCP_Server_Info *server,
        kfree(server->hostname);
 
        server->hostname = extract_hostname(name);
-       if (!server->hostname) {
-               cifs_dbg(FYI, "%s: failed to extract hostname from target: %d\n",
-                        __func__, -ENOMEM);
+       if (IS_ERR(server->hostname)) {
+               cifs_dbg(FYI,
+                        "%s: failed to extract hostname from target: %ld\n",
+                        __func__, PTR_ERR(server->hostname));
        }
 }
 
--

2.17.1

Signature · 3 lines
Thanks,

Steve