From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754036AbcHRK4F (ORCPT ); Thu, 18 Aug 2016 06:56:05 -0400 Received: from foss.arm.com ([217.140.101.70]:57460 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751627AbcHRKz7 (ORCPT ); Thu, 18 Aug 2016 06:55:59 -0400 Date: Thu, 18 Aug 2016 11:55:04 +0100 From: Lorenzo Pieralisi To: Dennis Chen Cc: iommu@lists.linux-foundation.org, Hanjun Guo , Tomasz Nowicki , "Rafael J. Wysocki" , Will Deacon , Marc Zyngier , Robin Murphy , Joerg Roedel , Jon Masters , Sinan Kaya , Nate Watterson , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nd@arm.com Subject: Re: [PATCH v4 09/15] drivers: acpi: iort: add support for ARM SMMU platform devices creation Message-ID: <20160818105452.GA8982@red-moon> References: <1471274620-20754-1-git-send-email-lorenzo.pieralisi@arm.com> <1471274620-20754-10-git-send-email-lorenzo.pieralisi@arm.com> <20160818105005.GA20404@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160818105005.GA20404@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 18, 2016 at 06:50:07PM +0800, Dennis Chen wrote: [...] > > +static void __init iort_smmu_init(void) > > +{ > > + struct acpi_iort_node *iort_node, *iort_end; > > + struct acpi_table_iort *iort; > > + struct fwnode_handle *fwnode; > > + int i, ret; > > + > > + /* > > + * table and iort will both point to the start of IORT table, but > > + * have different struct types > > + */ > > + iort = (struct acpi_table_iort *)iort_table; > > > If the firmware of a platform happens to miss the IORT table, then > iort_table here will be a NULL pointer, in this case 'NULL pointer > dereference' kernel panic will occur, if this is not an expected > behavior then we can add a sanity check here to avoid this. IORT > missing is a fatal error? I don't think so. Yes, I've already fixed it, thanks for pointing that out. Lorenzo