Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753114AbbKYMFV (ORCPT ); Wed, 25 Nov 2015 07:05:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:32834 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753068AbbKYMFT (ORCPT ); Wed, 25 Nov 2015 07:05:19 -0500 Message-ID: <5655A3FD.5040202@suse.de> Date: Wed, 25 Nov 2015 13:05:17 +0100 From: Hannes Reinecke User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Ching Huang , hch@infradead.org, thenzl@redhat.com, jbottomley@parallels.com, dan.carpenter@oracle.com, agordeev@redhat.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, jthumshirn@suse.de CC: hch@lst.de Subject: Re: [PATCH v3 2/5] arcmsr: fixes not release allocated resource References: <1448451683.4670.35.camel@Centos6.3-64> In-Reply-To: <1448451683.4670.35.camel@Centos6.3-64> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1782 Lines: 50 On 11/25/2015 12:41 PM, Ching Huang wrote: > From: Ching Huang > > Releasing allocated resource if get configuration data failed. > > Signed-of-by: Ching Huang > > --- > > diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c > --- a/drivers/scsi/arcmsr/arcmsr_hba.c 2015-11-24 11:35:26.000000000 +0800 > +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2015-11-25 19:04:44.590970000 +0800 > @@ -2664,7 +2664,7 @@ static bool arcmsr_hbaB_get_config(struc > if (!arcmsr_hbaB_wait_msgint_ready(acb)) { > printk(KERN_NOTICE "arcmsr%d: wait 'get adapter firmware \ > miscellaneous data' timeout \n", acb->host->host_no); > - return false; > + goto err_free_dma; > } > count = 8; > while (count){ > @@ -2707,6 +2707,10 @@ static bool arcmsr_hbaB_get_config(struc > acb->firm_cfg_version = readl(®->message_rwbuffer[25]); /*firm_cfg_version,25,100-103*/ > /*firm_ide_channels,4,16-19*/ > return true; > +err_free_dma: > + dma_free_coherent(&acb->pdev->dev, acb->roundup_ccbsize, > + acb->dma_coherent2, acb->dma_coherent_handle2); > + return false; > } > > static bool arcmsr_hbaC_get_config(struct AdapterControlBlock *pACB) > > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/