]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/rocket: fix unwinding in error path in rocket_core_init
authorQuentin Schulz <quentin.schulz@cherry.de>
Mon, 15 Dec 2025 16:36:14 +0000 (17:36 +0100)
committerTomeu Vizoso <tomeu@tomeuvizoso.net>
Sat, 10 Jan 2026 16:49:14 +0000 (17:49 +0100)
commitf509a081f6a289f7c66856333b3becce7a33c97e
treedb2feef06fba5517c7ee6134e0e69daf16f933a8
parentbafb6863dd8cea94e7dc2f90979b30292e8ea31c
accel/rocket: fix unwinding in error path in rocket_core_init

When rocket_job_init() is called, iommu_group_get() has already been
called, therefore we should call iommu_group_put() and make the
iommu_group pointer NULL. This aligns with what's done in
rocket_core_fini().

If pm_runtime_resume_and_get() somehow fails, not only should
rocket_job_fini() be called but we should also unwind everything done
before that, that is, disable PM, put the iommu_group, NULLify it and
then call rocket_job_fini(). This is exactly what's done in
rocket_core_fini() so let's call that function instead of duplicating
the code.

Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
Cc: stable@vger.kernel.org
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://patch.msgid.link/20251215-rocket-error-path-v1-1-eec3bf29dc3b@cherry.de
drivers/accel/rocket/rocket_core.c