Skip to contentSkip to conversation

fbdev: nvidia: Release write-combining handle on probe failure

PATCH In review Myeonghun Pak 2 participants 2 messages Sep 15

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev: nvidia: Release write-combining handle on probe failure

Failures in nvidia_set_fbinfo() or register_framebuffer() leave the handle from arch_phys_wc_add() allocated. Release it in the shared error path, as nvidiafb_remove() already does on normal removal.

The missing cleanup was already present in the initial Git import, when the driver used mtrr_add() directly.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Assisted-by LLM
---
 drivers/video/fbdev/nvidia/nvidia.c | 1 +
 1 file changed, 1 insertion(+)
drivers/video/fbdev/nvidia/nvidia.c +1 -0
@@ -1424,6 +1424,7 @@ static int nvidiafb_probe(struct pci_dev *pd, const struct pci_device_id *ent)
 	return 0;
 
 err_out_iounmap_fb:
+	arch_phys_wc_del(par->wc_cookie);
 	fb_destroy_modelist(&info->modelist);
 err_out_free_base1:
 	fb_destroy_modedb(info->monspecs.modedb);
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 16 lines · Myeonghun Pak

Failures in nvidia_set_fbinfo() or register_framebuffer() leave the handle from arch_phys_wc_add() allocated. Release it in the shared error path, as nvidiafb_remove() already does on normal removal.

The missing cleanup was already present in the initial Git import, when the driver used mtrr_add() directly.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Assisted-by LLM
Quoted 3 lines
---
  drivers/video/fbdev/nvidia/nvidia.c | 1 +
  1 file changed, 1 insertion(+)

Thanks for your patches!
I've added this one and the two similar ones regarding kyro and gxt4500 to the fbdev git tree.

Helge