aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2017-03-13 15:57:09 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-30 09:44:09 +0200
commit840065777b4d64afa9fafffe1eb1e4f7d1098df5 (patch)
tree73323517fef91ca9b8b0ee9a75daf1d8d8340a3e
parentf8dd767b84e2e6d477a760d87999d74c2580ea9a (diff)
downloadlinux-yocto-840065777b4d64afa9fafffe1eb1e4f7d1098df5.tar.gz
linux-yocto-840065777b4d64afa9fafffe1eb1e4f7d1098df5.tar.bz2
linux-yocto-840065777b4d64afa9fafffe1eb1e4f7d1098df5.zip
Drivers: hv: vmbus: Don't leak channel ids
commit 9a5476020a5f06a0fc6f17097efc80275d2f03cd upstream. If we cannot allocate memory for the channel, free the relid associated with the channel. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hv/channel_mgmt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 0af7e39006c8..a58cd102af1b 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -779,6 +779,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;
}