mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-26 06:04:14 +08:00
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:
parent
b99e1943fd
commit
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;
|
||||
|
Loading…
Reference in New Issue
Block a user