cifs: fix uninitialized pointer in error case in dfs_cache_get_tgt_share
[linux-2.6-microblaze.git] / fs / cifs / cifsfs.c
index 2b1a1c0..12c8728 100644 (file)
@@ -582,6 +582,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
                seq_puts(s, ",nocase");
        if (tcon->nodelete)
                seq_puts(s, ",nodelete");
+       if (cifs_sb->ctx->no_sparse)
+               seq_puts(s, ",nosparse");
        if (tcon->local_lease)
                seq_puts(s, ",locallease");
        if (tcon->retry)
@@ -836,7 +838,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
              int flags, struct smb3_fs_context *old_ctx)
 {
        int rc;
-       struct super_block *sb;
+       struct super_block *sb = NULL;
        struct cifs_sb_info *cifs_sb = NULL;
        struct cifs_mnt_data mnt_data;
        struct dentry *root;
@@ -932,9 +934,11 @@ out_super:
        return root;
 out:
        if (cifs_sb) {
-               kfree(cifs_sb->prepath);
-               smb3_cleanup_fs_context(cifs_sb->ctx);
-               kfree(cifs_sb);
+               if (!sb || IS_ERR(sb)) {  /* otherwise kill_sb will handle */
+                       kfree(cifs_sb->prepath);
+                       smb3_cleanup_fs_context(cifs_sb->ctx);
+                       kfree(cifs_sb);
+               }
        }
        return root;
 }