ACPI: Use fwnode_init() to set up fwnode
authorSaravana Kannan <saravanak@google.com>
Fri, 11 Dec 2020 20:26:29 +0000 (12:26 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Dec 2020 11:31:54 +0000 (12:31 +0100)
commit2ab695aa8eb8f3226f68a2b91fc6103b56fcb57d
tree314a2a2c0517c465e7d25b5e7d7d256093a9a598
parent2a0387e8128ae0c3de9ff976bc25afaae3d4a916
ACPI: Use fwnode_init() to set up fwnode

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 <qcai@redhat.com>
Suggested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Marc Zyngier <maz@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20201211202629.2164655-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/acpi.h