提交 803ab977 编写于 作者: D Dan Carpenter 提交者: Steve French

cifs: NULL dereference on allocation failure

We should just return directly here, the goto causes a NULL dereference.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <smfrench@gmail.com>
上级 c1aab02d
...@@ -3857,10 +3857,8 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) ...@@ -3857,10 +3857,8 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid)
struct smb_vol *vol_info; struct smb_vol *vol_info;
vol_info = kzalloc(sizeof(*vol_info), GFP_KERNEL); vol_info = kzalloc(sizeof(*vol_info), GFP_KERNEL);
if (vol_info == NULL) { if (vol_info == NULL)
tcon = ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
goto out;
}
vol_info->local_nls = cifs_sb->local_nls; vol_info->local_nls = cifs_sb->local_nls;
vol_info->linux_uid = fsuid; vol_info->linux_uid = fsuid;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册