1
0
Fork 0
alistair23-linux/sound/soc/nuc900
Russell King c9bd5e690a DMA-API: sound: fix dma mask handling in a lot of drivers
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.

Acked-by: Mark Brown <broonie@linaro.org>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-10-31 14:48:47 +00:00
..
Kconfig ASoC: NUC900/audio: add nuc900 audio driver support 2010-05-19 08:14:10 -07:00
Makefile ASoC: NUC900/audio: add nuc900 audio driver support 2010-05-19 08:14:10 -07:00
nuc900-ac97.c ASoC: nuc900: don't check resource with devm_ioremap_resource 2013-07-24 15:34:16 +01:00
nuc900-audio.c ASoC: nuc900: Add .owner to struct snd_soc_card 2011-12-23 11:16:58 +00:00
nuc900-audio.h ASoC: Fix compile error for nuc900-pcm.c 2010-11-29 18:28:53 +00:00
nuc900-pcm.c DMA-API: sound: fix dma mask handling in a lot of drivers 2013-10-31 14:48:47 +00:00