From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: [patch 3/3 -next] tcm_vhost: call kfree() on an error path Date: Thu, 12 Jul 2012 17:48:52 +0300 Message-ID: <20120712144852.GF24202@elgon.mountain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kernel-janitors@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org To: "Michael S. Tsirkin" , Nicholas Bellinger Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: kvm.vger.kernel.org There is a memory leak here. Signed-off-by: Dan Carpenter diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 57d39c5..29850cb 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -1420,6 +1420,7 @@ static struct se_wwn *tcm_vhost_make_tport( pr_err("Unable to locate prefix for emulated Target Port:" " %s\n", name); + kfree(tport); return ERR_PTR(-EINVAL); check_len: