[PATCH] cifs: NULL out tcon, pSesInfo, and srvTcp pointers when chasing DFS referrals

Jeff Layton jlayton at redhat.com
Wed Dec 2 11:16:20 MST 2009


The scenario is this:

We've got a valid tcon pointer and we're chasing a DFS referral. We put
the tcon reference, which puts the session reference too. Then we try
the mount again with the new mount info. That mount fails, and we goto
mount_fail_check. The tcon and pSesInfo pointers are non-NULL, but no
longer valid, and things blow up when we try to put references to them.

Fix this by zeroing out the tcon, tcp and smb session pointers before
retrying the mount.

Signed-off-by: Jeff Layton <jlayton at redhat.com>
---
 fs/cifs/connect.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 63ea83f..54f38f1 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2595,6 +2595,9 @@ remote_path_check:
 			else if (pSesInfo)
 				cifs_put_smb_ses(pSesInfo);
 
+			tcon = NULL;
+			pSesInfo = NULL;
+			srvTcp = NULL;
 			cleanup_volume_info(&volume_info);
 			referral_walks_count++;
 			goto try_mount_again;
-- 
1.6.5.2


--MP_/z=0KR08QrFlo3Ll6663AHxq--


More information about the linux-cifs-client mailing list