Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1582973pxu; Sat, 12 Dec 2020 18:50:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8oSHQEwG8VZbInzTxfpJxMScXGzA4XEMuJ9V7aiU78lxsnDK0QWlCXXmOvMsGguH95L2+ X-Received: by 2002:a17:906:ce51:: with SMTP id se17mr17017685ejb.314.1607827828997; Sat, 12 Dec 2020 18:50:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607827828; cv=none; d=google.com; s=arc-20160816; b=NrurVaMDm7Nq+O42PX1yvELJ1F/khwXHz2a0A3+vIvm8kRZoB/GfPzzUWQFRHj0VIw ysW3VMOpB9BHtmbKJfAs/pY5r6QuX4ApZ0cEH8X/RzqcyLBwWVxVFO905lRC2qYJK0ai biatyJzgitSSlFXAgspkxE6fh/za+GGrITjDlFCnuWOzOSgO2MhG/WEg0SA4eJR9PTsZ BVLcBF/gfWx3DPhNU/AHR3iuhYqOvz4MuxICwoNbxqcYsqYcwqVwNlYGOsWcAk8FVQ7s +ZVYUNBvPjVrD0NMRcQ4pKPOQ3Q5OKaTOysaiVSXfcVxkZZBZsS5vGNnTeEFWD+Sb1qd 3pEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CypzGPTKeRYFfU4+gMqSScNyWzGriRLRTX9ShT/rLG0=; b=SdgFHui6WiYribu9A3Aqiz3qfZ6+0PlIjriLkpKt/O/kpDDtLoOUHHk4NDjMuKgXky rrxaPl0KcBIC46G74UHTZo/rEBGszsnOgQH1PwCTrnXo+hCLNtDscvZ1OR3BmLWGHslw UQAAD/B7+AHwxdMiJbYfxWQpgiJxs/xVTDRrtLfd4NhuvG4h4gjgT0afHgrNk46ZLD2I A04kpqfalBbXVPLJBEaUd/GrOr18D4JgxihOwaKb/AoN67m87k0kaXanEnnbryXPncb+ 0Fdrr/eiEecKQnJueqDwqKyowVSbTWu8CjVnJ+LEnf/3RUadm4ldFUUxc9GQBeLgp/tJ xoPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s17si7119842eju.360.2020.12.12.18.50.06; Sat, 12 Dec 2020 18:50:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393927AbgLKUy2 (ORCPT + 99 others); Fri, 11 Dec 2020 15:54:28 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:60480 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392551AbgLKUxv (ORCPT ); Fri, 11 Dec 2020 15:53:51 -0500 Received: from 89-77-60-66.dynamic.chello.pl (89.77.60.66) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.530) id 852afc7a6c3a62dd; Fri, 11 Dec 2020 21:53:09 +0100 From: "Rafael J. Wysocki" To: Saravana Kannan , Greg Kroah-Hartman Cc: Len Brown , Rob Herring , Qian Cai , Robin Murphy , Marc Zyngier , kernel-team@android.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ACPI: Use fwnode_init() to set up fwnode Date: Fri, 11 Dec 2020 21:53:09 +0100 Message-ID: <3491615.yqrABBVLMz@kreacher> In-Reply-To: <20201211202629.2164655-1-saravanak@google.com> References: <20201211202629.2164655-1-saravanak@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, December 11, 2020 9:26:29 PM CET Saravana Kannan wrote: > Commit 01bb86b380a3 ("driver core: Add fwnode_init()") was supposed to > fix up all instances of fwnode creation to use fwnode_init(). But looks > like this instance was missed. This causes a NULL pointer dereference > during device_add() [1]. So, fix it. > > [ 60.792324][ T1] Call trace: > [ 60.795495][ T1] device_add+0xf60/0x16b0 > __fw_devlink_link_to_consumers at drivers/base/core.c:1583 > (inlined by) fw_devlink_link_device at drivers/base/core.c:1726 > (inlined by) device_add at drivers/base/core.c:3088 > [ 60.799813][ T1] platform_device_add+0x274/0x628 > [ 60.804833][ T1] acpi_iort_init+0x9d8/0xc50 > [ 60.809415][ T1] acpi_init+0x45c/0x4e8 > [ 60.813556][ T1] do_one_initcall+0x170/0xb70 > [ 60.818224][ T1] kernel_init_freeable+0x6a8/0x734 > [ 60.823332][ T1] kernel_init+0x18/0x12c > [ 60.827566][ T1] ret_from_fork+0x10/0x1c > [ 60.838756][ T1] ---[ end trace fa5c8ce17a226d83 ]--- > > [1] - https://lore.kernel.org/linux-arm-kernel/02e7047071f0b54b046ac472adeeb3fafabc643c.camel@redhat.com/ > Fixes: 01bb86b380a3 ("driver core: Add fwnode_init()") > Reported-by: Qian Cai > Suggested-by: Robin Murphy > Tested-by: Marc Zyngier > Signed-off-by: Saravana Kannan Acked-by: Rafael J. Wysocki > --- > Greg, > > Can you please pull this into driver-core-next since the commit that > causes this is only present in driver-core-next? > > -Saravana > > include/linux/acpi.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > index 39263c6b52e1..2630c2e953f7 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h > @@ -55,7 +55,7 @@ static inline struct fwnode_handle *acpi_alloc_fwnode_static(void) > if (!fwnode) > return NULL; > > - fwnode->ops = &acpi_static_fwnode_ops; > + fwnode_init(fwnode, &acpi_static_fwnode_ops); > > return fwnode; > } >