@@ -1422,12 +1422,14 @@ static int refresh_tcon(struct cifs_ses **sessions, struct cifs_tcon *tcon, bool
14221422	struct  TCP_Server_Info  * server  =  tcon -> ses -> server ;
14231423
14241424	mutex_lock (& server -> refpath_lock );
1425- 	if  (strcasecmp (server -> leaf_fullpath , server -> origin_fullpath ))
1426- 		__refresh_tcon (server -> leaf_fullpath  +  1 , sessions , tcon , force_refresh );
1425+ 	if  (server -> origin_fullpath ) {
1426+ 		if  (server -> leaf_fullpath  &&  strcasecmp (server -> leaf_fullpath ,
1427+ 							server -> origin_fullpath ))
1428+ 			__refresh_tcon (server -> leaf_fullpath  +  1 , sessions , tcon , force_refresh );
1429+ 		__refresh_tcon (server -> origin_fullpath  +  1 , sessions , tcon , force_refresh );
1430+ 	}
14271431	mutex_unlock (& server -> refpath_lock );
14281432
1429- 	__refresh_tcon (server -> origin_fullpath  +  1 , sessions , tcon , force_refresh );
1430- 
14311433	return  0 ;
14321434}
14331435
@@ -1530,11 +1532,14 @@ static void refresh_mounts(struct cifs_ses **sessions)
15301532		list_del_init (& tcon -> ulist );
15311533
15321534		mutex_lock (& server -> refpath_lock );
1533- 		if  (strcasecmp (server -> leaf_fullpath , server -> origin_fullpath ))
1534- 			__refresh_tcon (server -> leaf_fullpath  +  1 , sessions , tcon , false);
1535+ 		if  (server -> origin_fullpath ) {
1536+ 			if  (server -> leaf_fullpath  &&  strcasecmp (server -> leaf_fullpath ,
1537+ 								server -> origin_fullpath ))
1538+ 				__refresh_tcon (server -> leaf_fullpath  +  1 , sessions , tcon , false);
1539+ 			__refresh_tcon (server -> origin_fullpath  +  1 , sessions , tcon , false);
1540+ 		}
15351541		mutex_unlock (& server -> refpath_lock );
15361542
1537- 		__refresh_tcon (server -> origin_fullpath  +  1 , sessions , tcon , false);
15381543		cifs_put_tcon (tcon );
15391544	}
15401545}
0 commit comments