lkml.org 
[lkml]   [2015]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/5] arcmsr: fixes not release allocated resource
On 11/25/2015 12:41 PM, Ching Huang wrote:
> From: Ching Huang <ching2048@areca.com.tw>
>
> Releasing allocated resource if get configuration data failed.
>
> Signed-of-by: Ching Huang <ching2048@areca.com.tw>
>
> ---
>
> 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(&reg->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 <hare@suse.com>

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)


\
 
 \ /
  Last update: 2015-11-25 13:21    [W:0.058 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site