staging: hv: check kzalloc() result
If kzalloc() fails free allocated resources and exit. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Родитель
b99e1943fd
Коммит
e3eb7cdd11
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче