From: Jan Kiszka Date: Mon, 19 Aug 2024 15:24:51 +0000 (+0200) Subject: remoteproc: k3-r5: Fix error handling when power-up failed X-Git-Tag: v6.12-rc1~68^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ab27eb5866ccbf57715cfdba4b03d57776092fb;p=thirdparty%2Fkernel%2Flinux.git remoteproc: k3-r5: Fix error handling when power-up failed By simply bailing out, the driver was violating its rule and internal assumptions that either both or no rproc should be initialized. E.g., this could cause the first core to be available but not the second one, leading to crashes on its shutdown later on while trying to dereference that second instance. Fixes: 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1") Signed-off-by: Jan Kiszka Acked-by: Beleswar Padhi Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/9f481156-f220-4adf-b3d9-670871351e26@siemens.com Signed-off-by: Mathieu Poirier --- diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 60bd2042b0c60..747ee467da88c 100644 --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c @@ -1313,7 +1313,7 @@ init_rmem: dev_err(dev, "Timed out waiting for %s core to power up!\n", rproc->name); - return ret; + goto err_powerup; } } @@ -1329,6 +1329,7 @@ err_split: } } +err_powerup: rproc_del(rproc); err_add: k3_r5_reserved_mem_exit(kproc);