提交 e3eb7cdd 编写于 作者: K Kulikov Vasiliy 提交者: Greg Kroah-Hartman

staging: hv: check kzalloc() result

If kzalloc() fails free allocated resources and exit.
Signed-off-by: NKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 b99e1943
......@@ -465,6 +465,8 @@ static int VmbusChannelCreateGpadlHeader(void *Kbuffer, u32 Size,
sizeof(struct vmbus_channel_gpadl_header) +
sizeof(struct gpa_range) + pageCount * sizeof(u64);
msgHeader = kzalloc(msgSize, GFP_KERNEL);
if (msgHeader == NULL)
goto nomem;
msgHeader->MessageSize = msgSize;
gpaHeader = (struct vmbus_channel_gpadl_header *)msgHeader->Msg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册