浏览代码

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>
K. Y. Srinivasan 8 年之前
父节点
当前提交
9a5476020a
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/hv/channel_mgmt.c

+ 1 - 0
drivers/hv/channel_mgmt.c

@@ -796,6 +796,7 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
 	/* Allocate the channel object and save this offer. */
 	/* Allocate the channel object and save this offer. */
 	newchannel = alloc_channel();
 	newchannel = alloc_channel();
 	if (!newchannel) {
 	if (!newchannel) {
+		vmbus_release_relid(offer->child_relid);
 		pr_err("Unable to allocate channel object\n");
 		pr_err("Unable to allocate channel object\n");
 		return;
 		return;
 	}
 	}