[PATCH] arm64/dma-mapping: Fix null-pointer check
Russell King - ARM Linux
linux at armlinux.org.uk
Sat Jun 10 15:03:54 PDT 2017
On Sat, Jun 10, 2017 at 12:41:10PM -0700, Olav Haugan wrote:
> @@ -149,6 +140,11 @@ static void *__dma_alloc(struct device *dev, size_t size,
> bool coherent = is_device_dma_coherent(dev);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This re-introduces an instance that you say you're getting rid of...
> pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL, false);
>
> + if (!dev) {
> + WARN_ONCE(1, "Use an actual device structure for DMA allocation\n");
> + return NULL;
> + }
> +
> size = PAGE_ALIGN(size);
>
> if (!coherent && !gfpflags_allow_blocking(flags)) {
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
More information about the linux-arm-kernel
mailing list