@@ -1426,12 +1426,14 @@ static int refresh_tcon(struct cifs_ses **sessions, struct cifs_tcon *tcon, bool
14261426 struct TCP_Server_Info * server = tcon -> ses -> server ;
14271427
14281428 mutex_lock (& server -> refpath_lock );
1429- if (strcasecmp (server -> leaf_fullpath , server -> origin_fullpath ))
1430- __refresh_tcon (server -> leaf_fullpath + 1 , sessions , tcon , force_refresh );
1429+ if (server -> origin_fullpath ) {
1430+ if (server -> leaf_fullpath && strcasecmp (server -> leaf_fullpath ,
1431+ server -> origin_fullpath ))
1432+ __refresh_tcon (server -> leaf_fullpath + 1 , sessions , tcon , force_refresh );
1433+ __refresh_tcon (server -> origin_fullpath + 1 , sessions , tcon , force_refresh );
1434+ }
14311435 mutex_unlock (& server -> refpath_lock );
14321436
1433- __refresh_tcon (server -> origin_fullpath + 1 , sessions , tcon , force_refresh );
1434-
14351437 return 0 ;
14361438}
14371439
@@ -1534,11 +1536,14 @@ static void refresh_mounts(struct cifs_ses **sessions)
15341536 list_del_init (& tcon -> ulist );
15351537
15361538 mutex_lock (& server -> refpath_lock );
1537- if (strcasecmp (server -> leaf_fullpath , server -> origin_fullpath ))
1538- __refresh_tcon (server -> leaf_fullpath + 1 , sessions , tcon , false);
1539+ if (server -> origin_fullpath ) {
1540+ if (server -> leaf_fullpath && strcasecmp (server -> leaf_fullpath ,
1541+ server -> origin_fullpath ))
1542+ __refresh_tcon (server -> leaf_fullpath + 1 , sessions , tcon , false);
1543+ __refresh_tcon (server -> origin_fullpath + 1 , sessions , tcon , false);
1544+ }
15391545 mutex_unlock (& server -> refpath_lock );
15401546
1541- __refresh_tcon (server -> origin_fullpath + 1 , sessions , tcon , false);
15421547 cifs_put_tcon (tcon );
15431548 }
15441549}
0 commit comments