| From 0597c74f68cf8a001c43233bb87271050ea24c26 Mon Sep 17 00:00:00 2001 |
| From: "K. Y. Srinivasan" <kys@microsoft.com> |
| Date: Mon, 13 Mar 2017 15:57:09 -0700 |
| Subject: [PATCH] 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> |
| Cc: <stable@vger.kernel.org> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c |
| index 04508526f1d5..d1cb0c2d83cf 100644 |
| --- a/drivers/hv/channel_mgmt.c |
| +++ b/drivers/hv/channel_mgmt.c |
| @@ -700,6 +700,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; |
| } |
| -- |
| 2.12.0 |
| |