Commit 23324407 authored by Paulo Alcantara's avatar Paulo Alcantara Committed by Steve French

cifs: Only free DFS target list if we actually got one

Fix potential NULL ptr deref when DFS target list is empty.
Signed-off-by: default avatarPaulo Alcantara <palcantara@suse.de>
Reviewed-by: default avatarAurelien Aptel <aaptel@suse.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent e511d317
...@@ -452,8 +452,8 @@ cifs_reconnect(struct TCP_Server_Info *server) ...@@ -452,8 +452,8 @@ cifs_reconnect(struct TCP_Server_Info *server)
struct mid_q_entry *mid_entry; struct mid_q_entry *mid_entry;
struct list_head retry_list; struct list_head retry_list;
#ifdef CONFIG_CIFS_DFS_UPCALL #ifdef CONFIG_CIFS_DFS_UPCALL
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb = NULL;
struct dfs_cache_tgt_list tgt_list; struct dfs_cache_tgt_list tgt_list = {0};
struct dfs_cache_tgt_iterator *tgt_it = NULL; struct dfs_cache_tgt_iterator *tgt_it = NULL;
#endif #endif
...@@ -592,8 +592,8 @@ cifs_reconnect(struct TCP_Server_Info *server) ...@@ -592,8 +592,8 @@ cifs_reconnect(struct TCP_Server_Info *server)
cifs_dbg(VFS, "%s: failed to update vol info in DFS cache: rc = %d\n", cifs_dbg(VFS, "%s: failed to update vol info in DFS cache: rc = %d\n",
__func__, rc); __func__, rc);
} }
dfs_cache_free_tgts(&tgt_list);
} }
dfs_cache_free_tgts(&tgt_list);
#endif #endif
if (server->tcpStatus == CifsNeedNegotiate) if (server->tcpStatus == CifsNeedNegotiate)
mod_delayed_work(cifsiod_wq, &server->echo, 0); mod_delayed_work(cifsiod_wq, &server->echo, 0);
......
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