drm/qxl: Fix oops caused by missing free_irq on device teardown
Subsystems (4)
PATCH 1/1 drm/qxl: Fix oops caused by missing free_irq on device teardown
From: Jianping Liu <[email protected]>
After qxl.ko is unloaded, reading /proc/interrupts triggers an oops. qxl_irq_init() requests the PCI IRQ with the DRM device as dev_id, but qxl_device_fini() never frees it. The IRQ action therefore stays registered, and its name still points into the unloaded module.
To fix the oops, free the IRQ in qxl_device_fini() with the same dev_id passed to request_irq().
--- drivers/gpu/drm/qxl/qxl_kms.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/qxl/qxl_kms.c +3 -0
@@ -284,6 +284,8 @@ int qxl_device_init(struct qxl_device *qdev,void qxl_device_fini (struct qxl_device *qdev) {int cur_idx; +struct drm_device *ddev = &qdev->ddev; +struct pci_dev *pdev =to_pci_dev (ddev->dev);/* check if qxl_device_init() was successful (gc_work is initialized last) */ if (!qdev->gc_work.func)
@@ -306,6 +308,7 @@ void qxl_device_fini(struct qxl_device *qdev)wait_event_timeout (qdev->release_event,atomic_read (&qdev->release_count) ==0 ,HZ ); +free_irq (pdev->irq, ddev);flush_work (&qdev->gc_work);qxl_surf_evict (qdev);qxl_vram_evict (qdev);
Signature · 1 line
2.43.7
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 7 lines
From: Jianping Liu <[email protected]>
After qxl.ko is unloaded, reading
/proc/interruptstriggers an oops.qxl_irq_init()requests the PCI IRQ with the DRM device asdev_id, butqxl_device_fini()never frees it. The IRQ action therefore stays registered, and its name still points into the unloaded module.
Quoted 6 lines
To fix the oops, free the IRQ in
qxl_device_fini()with the samedev_idpassed torequest_irq().Fixes f64122c1f6ad ("drm: add new QXL driver. (v1.4)")Signed-off-by Jianping Liu <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1