From a2d6f76bb2bbc45ab9a534fdfe5c7f1617c0e87a Mon Sep 17 00:00:00 2001
From: Jeff Layton <jlayton@redhat.com>
Date: Wed, 2 Dec 2009 13:16:20 -0500
Subject: [PATCH] cifs: NULL out tcon, pSesInfo, and srvTcp pointers when chasing DFS referrals
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@redhat.com>
---
fs/cifs/connect.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
@@ -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