Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752332AbcKUGBm (ORCPT ); Mon, 21 Nov 2016 01:01:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:36267 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbcKUGBk (ORCPT ); Mon, 21 Nov 2016 01:01:40 -0500 Subject: Re: [PATCH] xen-scsifront: Add a missing call to kfree To: Quentin Lambert , Boris Ostrovsky , David Vrabel , "James E.J. Bottomley" , "Martin K. Petersen" , xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20161119182256.9081-1-lambert.quentin@gmail.com> From: Juergen Gross Message-ID: <1320a162-dc36-5833-a746-367134dae5e7@suse.com> Date: Mon, 21 Nov 2016 07:01:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161119182256.9081-1-lambert.quentin@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 756 Lines: 30 On 19/11/16 19:22, Quentin Lambert wrote: > Most error branches following the call to kmalloc contain > a call to kfree. This patch add these calls where they are > missing. > > This issue was found with Hector. > > Signed-off-by: Quentin Lambert Nice catch. I think this will need some more work, I'll do a follow-on patch. Reviewed-by: Juergen Gross > > --- > drivers/scsi/xen-scsifront.c | 1 + > 1 file changed, 1 insertion(+) > > --- a/drivers/scsi/xen-scsifront.c > +++ b/drivers/scsi/xen-scsifront.c > @@ -627,6 +627,7 @@ static int scsifront_action_handler(stru > > if (scsifront_enter(info)) { > spin_unlock_irq(host->host_lock); > + kfree(shadow); > return FAILED; > } > >