Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751762AbdFJWEE (ORCPT ); Sat, 10 Jun 2017 18:04:04 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:41352 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751633AbdFJWED (ORCPT ); Sat, 10 Jun 2017 18:04:03 -0400 Date: Sat, 10 Jun 2017 23:03:54 +0100 From: Russell King - ARM Linux To: Olav Haugan Cc: catalin.marinas@arm.com, will.deacon@arm.com, robin.murphy@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64/dma-mapping: Fix null-pointer check Message-ID: <20170610220354.GY4902@n2100.armlinux.org.uk> References: <20170610194110.27712-1-ohaugan@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170610194110.27712-1-ohaugan@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 760 Lines: 22 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.