Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79ee9a8b authored by Steve French's avatar Steve French
Browse files

[CIFS] cifs: fix oops on mount when CONFIG_CIFS_DFS_UPCALL is enabled

simple "mount -t cifs //xxx /mnt" oopsed on strlen of options
http://kerneloops.org/guilty.php?guilty=cifs_get_sb&version=2.6.25-release&start=16711

 \
68&end=1703935&class=oops

Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent dbdbb876
Loading
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -97,9 +97,6 @@ cifs_read_super(struct super_block *sb, void *data,
{
	struct inode *inode;
	struct cifs_sb_info *cifs_sb;
#ifdef CONFIG_CIFS_DFS_UPCALL
	int len;
#endif
	int rc = 0;

	/* BB should we make this contingent on mount parm? */
@@ -117,7 +114,8 @@ cifs_read_super(struct super_block *sb, void *data,
	 * complex operation (mount), and in case of fail
	 * just exit instead of doing mount and attempting
	 * undo it if this copy fails?*/
	len = strlen(data);
	if (data) {
		int len = strlen(data);
		cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
		if (cifs_sb->mountdata == NULL) {
			kfree(sb->s_fs_info);
@@ -126,6 +124,7 @@ cifs_read_super(struct super_block *sb, void *data,
		}
		strncpy(cifs_sb->mountdata, data, len + 1);
		cifs_sb->mountdata[len] = '\0';
	}
#endif

	rc = cifs_mount(sb, cifs_sb, data, devname);