[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170610220354.GY4902@n2100.armlinux.org.uk>
Date: Sat, 10 Jun 2017 23:03:54 +0100
From: Russell King - ARM Linux <linux@...linux.org.uk>
To: Olav Haugan <ohaugan@...eaurora.org>
Cc: catalin.marinas@....com, will.deacon@....com, robin.murphy@....com,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] arm64/dma-mapping: Fix null-pointer check
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.
Powered by blists - more mailing lists