Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754271AbdCMW6W (ORCPT ); Mon, 13 Mar 2017 18:58:22 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:34508 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752907AbdCMW6N (ORCPT ); Mon, 13 Mar 2017 18:58:13 -0400 x-originating-ip: 107.180.71.197 From: kys@exchange.microsoft.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com, marcelo.cerri@canonical.com Cc: "K. Y. Srinivasan" , Subject: [PATCH 1/1] Drivers: hv: vmbus: Don't leak channel ids Date: Mon, 13 Mar 2017 15:57:09 -0700 Message-Id: <1489445829-15292-1-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfK6awOqHqKeD/jCByH621Km8DDOwdolyOI3UUJbfdMEzuBGhAJ6TSifcgALQQ56nJZOZzyqXV6i0GlQGo8SziQ1agI8bWfepTQipetwtbMaxIYXAhQec Z0jVIydXF9pm9e2Np9XV/zvD+FzE9ktwcB0jPf/rai2WQml+S2zhDjr2VOEVsNylzg5eM36fOfgnFP7zzsewmcUv64I0KG8ZVjvV1e2PfjCFPTZTV6xBDuz8 HQSqVn2A6TvQGZQj3UAalksTsPYGE2tx3n2szhSDmM6aFRFMP1cMVmWW8ygNW9su7dGhi6/o92jhxT8N9kiwLHb0mYIL1tFm6mlPU2h3CPe2dkI9JHgJyHQi aSasi0sF+JDsk0lrP/b5UX+tjyQQgzdK0t6Z4tEZAoHMiOYbEaCmDQ106gEW7fj0IsIuNf+Vh0Xm7YRdwT03CU+bIJLnjeb+445WiSPNqMntxHZhVPxcSjmS vbUUjsLw4NCfAibB1qfj+QG126GHRrKI/Nm6DEuHs407HMihyWhzrPyo6r2yAdj2MpKUlaJC3gx1Q3Ht Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 785 Lines: 25 From: K. Y. Srinivasan If we cannot allocate memory for the channel, free the relid associated with the channel. Signed-off-by: K. Y. Srinivasan Cc: --- 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 e1a3ae4..0a85246 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -802,6 +802,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; } -- 1.7.1