diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2017-03-13 18:57:09 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-16 03:42:33 -0400 |
commit | 9a5476020a5f06a0fc6f17097efc80275d2f03cd (patch) | |
tree | e881d2468b3c196f812ea540c0e5ffcebfc1e8f0 /drivers | |
parent | 5a16dfc855127906fcd2935fb039bc8989313915 (diff) |
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 <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-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 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) | |||
796 | /* Allocate the channel object and save this offer. */ | 796 | /* Allocate the channel object and save this offer. */ |
797 | newchannel = alloc_channel(); | 797 | newchannel = alloc_channel(); |
798 | if (!newchannel) { | 798 | if (!newchannel) { |
799 | vmbus_release_relid(offer->child_relid); | ||
799 | pr_err("Unable to allocate channel object\n"); | 800 | pr_err("Unable to allocate channel object\n"); |
800 | return; | 801 | return; |
801 | } | 802 | } |