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

Commit 803ab977 authored by Dan Carpenter's avatar Dan Carpenter Committed by Steve French
Browse files

cifs: NULL dereference on allocation failure



We should just return directly here, the goto causes a NULL dereference.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
parent c1aab02d
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -3857,10 +3857,8 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid)
	struct smb_vol *vol_info;

	vol_info = kzalloc(sizeof(*vol_info), GFP_KERNEL);
	if (vol_info == NULL) {
		tcon = ERR_PTR(-ENOMEM);
		goto out;
	}
	if (vol_info == NULL)
		return ERR_PTR(-ENOMEM);

	vol_info->local_nls = cifs_sb->local_nls;
	vol_info->linux_uid = fsuid;