Re: [PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 26, 2013 at 09:51:23AM +0200, Takashi Iwai wrote:
> Hi,
> 
> sorry for the lat response, as I've been traveling in the last weeks.
> 
> At Thu, 19 Sep 2013 22:53:02 +0100,
> Russell King wrote:
> > 
> > This code sequence is unsafe in modules:
> > 
> > static u64 mask = DMA_BIT_MASK(something);
> > ...
> > 	if (!dev->dma_mask)
> > 		dev->dma_mask = &mask;
> > 
> > as if a module is reloaded, the mask will be pointing at the original
> > module's mask address, and this can lead to oopses.  Moreover, they
> > all follow this with:
> > 
> > 	if (!dev->coherent_dma_mask)
> > 		dev->coherent_dma_mask = mask;
> > 
> > where 'mask' is the same value as the statically defined mask, and this
> > bypasses the architecture's check on whether the DMA mask is possible.
> > 
> > Fix these issues by using the new dma_coerce_coherent_and_mask()
> > function.
> > 
> > Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
> 
> Applied with Mark's ack now.

Which is a very stupid thing to do because you won't have
dma_coerce_coherent_and_mask() in your tree, so all these drivers
will fail to build for you.
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux