lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1203102243070.1971@localhost6.localdomain6>
Date:	Sat, 10 Mar 2012 22:50:42 +0100 (CET)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	walter harms <wharms@....de>
cc:	Julia Lawall <Julia.Lawall@...6.fr>,
	Jeff Garzik <jgarzik@...ox.com>,
	kernel-janitors@...r.kernel.org,
	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org,
	devicetree-discuss@...ts.ozlabs.org
Subject: Re: [PATCH] drivers/ata/pata_mpc52xx.c: add missing kfree



On Sat, 10 Mar 2012, walter harms wrote:

>
>
> Am 10.03.2012 18:56, schrieb Julia Lawall:
>> From: Julia Lawall <Julia.Lawall@...6.fr>
>>
>> There is no need to call the devm cleanup functions on failure of a probe
>> or remove function.
>>
>> Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>
>>
>> ---
>>  drivers/ata/pata_mpc52xx.c |   11 -----------
>>  1 file changed, 11 deletions(-)
>>
>> diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
>> index 00748ae..1f02008 100644
>> --- a/drivers/ata/pata_mpc52xx.c
>> +++ b/drivers/ata/pata_mpc52xx.c
>> @@ -806,17 +806,12 @@ mpc52xx_ata_probe(struct platform_device *op)
>>  	return 0;
>>
>>   err:
>> -	devm_release_mem_region(&op->dev, res_mem.start, sizeof(*ata_regs));
>>  	if (ata_irq)
>>  		irq_dispose_mapping(ata_irq);
>>  	if (task_irq)
>>  		irq_dispose_mapping(task_irq);
>
> hi julia,
> i did a quick look at lxr and it showed that irq_dispose_mapping()
> is only used with powerpc, and here is it checking for
> 	if (virq == NO_IRQ)
>            return;
>
> I do not know how current the lxt on free-electrons.com is but perhaps
> it is possible to dump the if (ata_irq) stuff.
>
> can you double check it ?

The definition in v3.2.9/kernel/irq/irqdomain.c does nothing but says:

nothing yet; will be filled when support for dynamic allocation of
irq_descs is added to irq_domain

So it would seem better to keep the call.  On the other hand, the error 
handling code of this function seems to be a mess.  When the 
initialization of ata_irq fails, it just returns instead of cleaning up. 
Prior code goes to err.  On ther other hand, now that the devm cleanups 
are gone, it is the goto err, which is unnecessary.  I'll look at the code 
some more.

julia

>
> re,
> wh
>
>
>>  	if (dmatsk)
>>  		bcom_ata_release(dmatsk);
>> -	if (ata_regs)
>> -		devm_iounmap(&op->dev, ata_regs);
>> -	if (priv)
>> -		devm_kfree(&op->dev, priv);
>>  	return rv;
>>  }
>>
>> @@ -835,12 +830,6 @@ mpc52xx_ata_remove(struct platform_device *op)
>>  	bcom_ata_release(priv->dmatsk);
>>  	irq_dispose_mapping(priv->ata_irq);
>>
>> -	/* Clear up IO allocations */
>> -	devm_iounmap(&op->dev, priv->ata_regs);
>> -	devm_release_mem_region(&op->dev, priv->ata_regs_pa,
>> -				sizeof(*priv->ata_regs));
>> -	devm_kfree(&op->dev, priv);
>> -
>>  	return 0;
>>  }
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
>> the body of a message to majordomo@...r.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ