Skip to content

Commit 0a9c56d

Browse files
testacegitdz
authored andcommitted
drm/loongson: Use managed KMS polling
lsdc_pci_probe() initializes KMS polling before setting up vblank support, requesting the IRQ and registering the DRM device. If any of those later steps fails, probe returns without finalizing polling. The driver also never finalizes polling on regular removal. Use drmm_kms_helper_poll_init() so polling is tied to the DRM device lifetime and automatically finalized on probe failure and device removal. This issue was identified during our ongoing static-analysis research while reviewing kernel code. Fixes: f39db26 ("drm: Add kms driver for loongson display controller") Cc: stable@vger.kernel.org Co-developed-by: Ijae Kim <ae878000@gmail.com> Signed-off-by: Ijae Kim <ae878000@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Jianmin Lv <lvjianmin@loongson.cn> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Myeonghun Pak <mhun512@gmail.com> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/20260513065706.23803-1-mhun512@gmail.com
1 parent 1d59f36 commit 0a9c56d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/loongson/lsdc_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static int lsdc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
293293

294294
vga_client_register(pdev, lsdc_vga_set_decode);
295295

296-
drm_kms_helper_poll_init(ddev);
296+
drmm_kms_helper_poll_init(ddev);
297297

298298
if (loongson_vblank) {
299299
ret = drm_vblank_init(ddev, descp->num_of_crtc);

0 commit comments

Comments
 (0)