From: K. Y. Srinivasan Date: Mon, 13 Mar 2017 22:57:09 +0000 (-0700) Subject: Drivers: hv: vmbus: Don't leak channel ids X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9a5476020a5f06a0fc6f17097efc80275d2f03cd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Drivers: hv: vmbus: Don't leak channel ids If we cannot allocate memory for the channel, free the relid associated with the channel. Signed-off-by: K. Y. Srinivasan Cc: Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index bf846d078d85..fbcb06352308 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -796,6 +796,7 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr) /* Allocate the channel object and save this offer. */ newchannel = alloc_channel(); if (!newchannel) { + vmbus_release_relid(offer->child_relid); pr_err("Unable to allocate channel object\n"); return; }