From patchwork Thu Jul 12 14:48:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 1189321 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6C1F840B20 for ; Thu, 12 Jul 2012 14:49:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933982Ab2GLOtM (ORCPT ); Thu, 12 Jul 2012 10:49:12 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:33618 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161154Ab2GLOtL (ORCPT ); Thu, 12 Jul 2012 10:49:11 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q6CEn1wn010265 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 Jul 2012 14:49:02 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q6CEn09l000920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jul 2012 14:49:00 GMT Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q6CEn0N8017324; Thu, 12 Jul 2012 09:49:00 -0500 Received: from elgon.mountain (/41.139.221.94) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 12 Jul 2012 07:48:59 -0700 Date: Thu, 12 Jul 2012 17:48:52 +0300 From: Dan Carpenter To: "Michael S. Tsirkin" , Nicholas Bellinger Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, kernel-janitors@vger.kernel.org Subject: [patch 3/3 -next] tcm_vhost: call kfree() on an error path Message-ID: <20120712144852.GF24202@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org There is a memory leak here. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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: