1
0
Fork 0

cifs: Avoid error pointer dereference

The patch 7d6535b72042: "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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
zero-sugar-mainline-defconfig
Samuel Cabrero 2020-12-18 10:29:49 +01:00 committed by Steve French
parent 0f2c66ae5c
commit 0bf1bafb17
1 changed files with 1 additions and 0 deletions

View File

@ -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);