drm/amdgpu: Fix memory leak in hpd_rx_irq_create_workqueue()
authorRafael Mendonca <rafaelmendsr@gmail.com>
Mon, 12 Sep 2022 22:34:32 +0000 (19:34 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:54 +0000 (12:34 +0200)
commit3ba3814c00a4817eb1cd31eff08d921c40e5f3a4
tree2ffb2a43296f49bf9ad8e5c9cb70e099a75937d2
parenta5ce83e85d795ec98697039ecc518b21d5810adc
drm/amdgpu: Fix memory leak in hpd_rx_irq_create_workqueue()

[ Upstream commit 7136f956c73c4ba50bfeb61653dfd6a9669ea915 ]

If construction of the array of work queues to handle hpd_rx_irq offload
work fails, we need to unwind. Destroy all the created workqueues and
the allocated memory for the hpd_rx_irq_offload_work_queue struct array.

Fixes: 8e794421bc98 ("drm/amd/display: Fork thread to offload work of hpd_rx_irq")
Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c