aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-07-06 08:10:37 -0400
committerSteve French <sfrench@us.ibm.com>2011-07-06 16:03:05 -0400
commitf9e59bcba2cff580a3ccf62e89460f9eed295d89 (patch)
tree0b1409174fa9e2be92b8b34b810749138f66dbee /fs/cifs
parentb2a0fa152072f0085fa8d8eb0dbf9b3b0c5952fc (diff)
cifs: have cifs_cleanup_volume_info not take a double pointer
...as that makes for a cumbersome interface. Make it take a regular smb_vol pointer and rely on the caller to zero it out if needed. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsfs.c2
-rw-r--r--fs/cifs/cifsproto.h2
-rw-r--r--fs/cifs/connect.c10
3 files changed, 5 insertions, 9 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 35f9154615fa..e11b83149833 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -713,7 +713,7 @@ cifs_do_mount(struct file_system_type *fs_type,
713out_super: 713out_super:
714 deactivate_locked_super(sb); 714 deactivate_locked_super(sb);
715out: 715out:
716 cifs_cleanup_volume_info(&volume_info); 716 cifs_cleanup_volume_info(volume_info);
717 return root; 717 return root;
718 718
719out_mountdata: 719out_mountdata:
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 257f312ede42..53b1b13581c6 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -154,7 +154,7 @@ extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *,
154extern void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, 154extern void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
155 struct cifs_sb_info *cifs_sb); 155 struct cifs_sb_info *cifs_sb);
156extern int cifs_match_super(struct super_block *, void *); 156extern int cifs_match_super(struct super_block *, void *);
157extern void cifs_cleanup_volume_info(struct smb_vol **pvolume_info); 157extern void cifs_cleanup_volume_info(struct smb_vol *pvolume_info);
158extern int cifs_setup_volume_info(struct smb_vol **pvolume_info, 158extern int cifs_setup_volume_info(struct smb_vol **pvolume_info,
159 char *mount_data, const char *devname); 159 char *mount_data, const char *devname);
160extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *); 160extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *);
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 44376ce41e42..dd064075ddfb 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2831,14 +2831,11 @@ is_path_accessible(int xid, struct cifs_tcon *tcon,
2831} 2831}
2832 2832
2833void 2833void
2834cifs_cleanup_volume_info(struct smb_vol **pvolume_info) 2834cifs_cleanup_volume_info(struct smb_vol *volume_info)
2835{ 2835{
2836 struct smb_vol *volume_info; 2836 if (!volume_info)
2837
2838 if (!pvolume_info || !*pvolume_info)
2839 return; 2837 return;
2840 2838
2841 volume_info = *pvolume_info;
2842 kfree(volume_info->username); 2839 kfree(volume_info->username);
2843 kzfree(volume_info->password); 2840 kzfree(volume_info->password);
2844 kfree(volume_info->UNC); 2841 kfree(volume_info->UNC);
@@ -2847,7 +2844,6 @@ cifs_cleanup_volume_info(struct smb_vol **pvolume_info)
2847 kfree(volume_info->iocharset); 2844 kfree(volume_info->iocharset);
2848 kfree(volume_info->prepath); 2845 kfree(volume_info->prepath);
2849 kfree(volume_info); 2846 kfree(volume_info);
2850 *pvolume_info = NULL;
2851 return; 2847 return;
2852} 2848}
2853 2849
@@ -2990,7 +2986,7 @@ int cifs_setup_volume_info(struct smb_vol **pvolume_info, char *mount_data,
2990 *pvolume_info = volume_info; 2986 *pvolume_info = volume_info;
2991 return rc; 2987 return rc;
2992out: 2988out:
2993 cifs_cleanup_volume_info(&volume_info); 2989 cifs_cleanup_volume_info(volume_info);
2994 return rc; 2990 return rc;
2995} 2991}
2996 2992