diff --git a/[refs] b/[refs] index eef5820a42e0..7a4c350b997c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 40961de3350b99cfa93cd80437cb39ec287f839a +refs/heads/master: f38cf9ccd61d2acd5bc9121fabf2f6e77d74b885 diff --git a/trunk/drivers/staging/hv/channel.c b/trunk/drivers/staging/hv/channel.c index 69b5641151e0..1833f275d0f8 100644 --- a/trunk/drivers/staging/hv/channel.c +++ b/trunk/drivers/staging/hv/channel.c @@ -355,9 +355,24 @@ static int create_gpadl_header(void *kbuffer, u32 size, sizeof(struct vmbus_channel_gpadl_body) + pfncurr * sizeof(u64); msgbody = kzalloc(msgsize, GFP_KERNEL); - /* FIXME: we probably need to more if this fails */ - if (!msgbody) + + if (!msgbody) { + struct vmbus_channel_msginfo *pos = NULL; + struct vmbus_channel_msginfo *tmp = NULL; + /* + * Free up all the allocated messages. + */ + list_for_each_entry_safe(pos, tmp, + &msgheader->submsglist, + msglistentry) { + + list_del(&pos->msglistentry); + kfree(pos); + } + goto nomem; + } + msgbody->msgsize = msgsize; (*messagecount)++; gpadl_body =