]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/arm/komeda: fix error handling for clk_prepare_enable() and callers
authorGustavo Kenji Mendonça Kaneko <kaneko.dev@pm.me>
Tue, 9 Jun 2026 13:08:33 +0000 (13:08 +0000)
committerLiviu Dudau <liviu.dudau@arm.com>
Tue, 30 Jun 2026 14:26:54 +0000 (15:26 +0100)
commit6502eb8cfcd6f7bc5f1f8b73ee524112bd93319d
tree40714f09ab8c7cf22c29524c50cf17c5a54ae266
parent46f715a16989f4e7bbbc2eb41447051874b027f3
drm/arm/komeda: fix error handling for clk_prepare_enable() and callers

komeda_dev_resume() calls clk_prepare_enable() without checking the
return value. If the clock fails to enable, the function returns 0
(success) while IRQs are enabled and IOMMU is connected on potentially
unclocked hardware, causing undefined behavior on resume.

Propagate the error from clk_prepare_enable() and fix all call sites
in komeda_drv.c that previously ignored the return value of
komeda_dev_resume():

- komeda_platform_probe(): if resume fails, jump to err_destroy_mdev
  (skipping the suspend call, since the clock was never enabled)
- komeda_pm_resume(): propagate the error and skip
  drm_mode_config_helper_resume() on failure

This issue was found by code review without access to Komeda hardware.

Signed-off-by: Gustavo Kenji Mendonça Kaneko <kaneko.dev@pm.me>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20260609130828.1066038-1-kaneko.dev@pm.me
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
drivers/gpu/drm/arm/display/komeda/komeda_dev.c
drivers/gpu/drm/arm/display/komeda/komeda_drv.c