Commit 0bf1bafb authored by Samuel Cabrero's avatar Samuel Cabrero Committed by Steve French

cifs: Avoid error pointer dereference

The patch 7d6535b7: "cifs: Simplify reconnect code when dfs
upcall is enabled" leads to the following static checker warning:

	fs/cifs/connect.c:160 reconn_set_next_dfs_target()
	error: 'server->hostname' dereferencing possible ERR_PTR()

Avoid dereferencing the error pointer by early returning on error
condition.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSamuel Cabrero <scabrero@suse.de>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 0f2c66ae
......@@ -155,6 +155,7 @@ static void reconn_set_next_dfs_target(struct TCP_Server_Info *server,
cifs_dbg(FYI,
"%s: failed to extract hostname from target: %ld\n",
__func__, PTR_ERR(server->hostname));
return;
}
rc = reconn_set_ipaddr_from_hostname(server);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment