diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2017-03-14 01:57:09 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-30 10:41:27 +0300 |
commit | b1f6b0a5a066196e0bf1d504a7afaef4643a13ad (patch) | |
tree | 120d8ff3a41d47f790a25e511e7dd78fd8d10e80 | |
parent | 3076066bb5076411627f9dffd9d59ff2497f7eac (diff) | |
download | linux-b1f6b0a5a066196e0bf1d504a7afaef4643a13ad.tar.xz |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index cb9531541a12..d8bc4b910192 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; } |