[SRU][H/raspi][PATCH 5/5] UBUNTU: firmware: raspberrypi: Partially revert 'firmware: bcm2835: Support ARCH_BCM270x'

Juerg Haefliger juerg.haefliger at canonical.com
Fri Nov 12 12:04:11 UTC 2021


BugLink: https://bugs.launchpad.net/bugs/1950064

The upstream commit 09cbd1df7d26 ("firmware: raspberrypi: Fix a leak in
'rpi_firmware_get()'") releases a reference which was never taken in
our kernel due to a downstream raspberrypi commit. This leads to a kernel
crash but apparently only on Pi 3 and 2. Fix that by reverting part of
the downstream commit which also happend recently in the downstream kernel
but silently during a merge...

Signed-off-by: Juerg Haefliger <juergh at canonical.com>
---
 drivers/firmware/raspberrypi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
index 45b4dca385e6..c2c125972d23 100644
--- a/drivers/firmware/raspberrypi.c
+++ b/drivers/firmware/raspberrypi.c
@@ -432,7 +432,7 @@ static int rpi_firmware_remove(struct platform_device *pdev)
  */
 struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node)
 {
-	struct platform_device *pdev = g_pdev;
+	struct platform_device *pdev = of_find_device_by_node(firmware_node);
 	struct rpi_firmware *fw;
 
 	if (!pdev)
-- 
2.30.2




More information about the kernel-team mailing list