aboutsummaryrefslogtreecommitdiff
path: root/drivers/hv
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2017-04-04 14:19:07 +0200
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2017-04-04 14:19:07 +0200
commite5cf6bfc638c79dde1a23af3cfd1ae8457d6416b (patch)
tree3564f30a8992be2f1a5cef5d1015ce95ff59dff9 /drivers/hv
parent09254782a748bc6a913ab877a951edde85e306a0 (diff)
parentf6767727467056943bf6d3433ffce0a8b2b05681 (diff)
Merge tag 'v4.9.20' into linux-4.9.y-rt
This is the 4.9.20 stable release
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/channel.c13
-rw-r--r--drivers/hv/channel_mgmt.c1
2 files changed, 9 insertions, 5 deletions
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index be34547cdb68..1606e7f08f4b 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -506,12 +506,15 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
wait_for_completion(&info->waitevent);
- if (channel->rescind) {
- ret = -ENODEV;
- goto post_msg_err;
- }
-
post_msg_err:
+ /*
+ * If the channel has been rescinded;
+ * we will be awakened by the rescind
+ * handler; set the error code to zero so we don't leak memory.
+ */
+ if (channel->rescind)
+ ret = 0;
+
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_del(&info->msglistentry);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
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;
}