From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH] ACPI/IORT: Fix iort_get_platform_device_domain() uninitialized pointer value Date: Fri, 30 Nov 2018 13:21:03 +0000 Message-ID: <20181130132102.GC9000@arm.com> References: <20181129095559.26007-1-lorenzo.pieralisi@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20181129095559.26007-1-lorenzo.pieralisi@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Lorenzo Pieralisi Cc: Catalin Marinas , "Rafael J. Wysocki" , Patrick Bellasi , linux-acpi@vger.kernel.org, Hanjun Guo , Sudeep Holla , linux-arm-kernel@lists.infradead.org List-Id: linux-acpi@vger.kernel.org On Thu, Nov 29, 2018 at 09:55:59AM +0000, Lorenzo Pieralisi wrote: > Running the Clang static analyzer on IORT code detected the following > error: > > Logic error: Branch condition evaluates to a garbage value > > in > > iort_get_platform_device_domain() > > If the named component associated with a given device has no IORT > mappings, iort_get_platform_device_domain() exits its MSI mapping loop > with msi_parent pointer containing garbage, which can lead to erroneous > code path execution. > > Initialize the msi_parent pointer, fixing the bug. > > Fixes: d4f54a186667 ("ACPI: platform: setup MSI domain for ACPI based > platform device") > Reported-by: Patrick Bellasi > Signed-off-by: Lorenzo Pieralisi > Cc: Will Deacon > Cc: Hanjun Guo > Cc: Sudeep Holla > Cc: Catalin Marinas > Cc: "Rafael J. Wysocki" > --- > drivers/acpi/arm64/iort.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Acked-by: Will Deacon Looks like one for 4.20. Will > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > index 2a361e22d38d..70f4e80b9246 100644 > --- a/drivers/acpi/arm64/iort.c > +++ b/drivers/acpi/arm64/iort.c > @@ -700,7 +700,7 @@ static void iort_set_device_domain(struct device *dev, > */ > static struct irq_domain *iort_get_platform_device_domain(struct device *dev) > { > - struct acpi_iort_node *node, *msi_parent; > + struct acpi_iort_node *node, *msi_parent = NULL; > struct fwnode_handle *iort_fwnode; > struct acpi_iort_its_group *its; > int i; > -- > 2.19.2 >