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]
Date:	Mon, 20 Jul 2015 10:28:14 +0200 (CEST)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	Alex Smith <alex.smith@...tec.com>
cc:	Julia Lawall <julia.lawall@...6.fr>, Zubair.Kakakhel@...tec.com,
	dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: question about drivers/dma/dma-jz4780.c

On Mon, 20 Jul 2015, Alex Smith wrote:

> On 19/07/2015 10:08, Julia Lawall wrote:
> > The file drivers/dma/dma-jz4780.c has a probe function that sets up irqs
> > using devm_request_irq.  The probe function then ends with:
> >
> > err_unregister_dev:
> > 	dma_async_device_unregister(dd);
> >
> > err_disable_clk:
> >          clk_disable_unprepare(jzdma->clk);
> > 	return ret;
> > }
> >
> > The remove function, on the other hand contains:
> >
> >          of_dma_controller_free(pdev->dev.of_node);
> >          devm_free_irq(&pdev->dev, jzdma->irq, jzdma);
> >          dma_async_device_unregister(&jzdma->dma_device);
> >
> > The need for calling devm_free_irq explicitly would be that it needs to
> > occur before dma_async_device_unregister, to eg avoid a reference to a
> > dangling pointer.  But devm_free_irq is implicitly called after the call
> > to dma_async_device_unregister at the end of the probe function.  Which
> > one is correct?
> >
> > julia
>
> Hi,
>
> I think the explicit devm_free_irq() here is unnecessary, as when remove is
> called there should be no remaining users of the DMA controller and therefore
> no chance of an IRQ occurring between the controller being unregistered and an
> implicit IRQ release afterwards.
>
> I recently sent a series of fixes for this driver, I will send a new version
> with a patch to remove the unnecessary free.

Great.  Thanks.

julia
--
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