Skip to contentSkip to conversation

media: ivtv: Fix exception handling in ivtvfb_init_vidmode()

PATCH New Markus Elfring 1 participant 1 message May 24, 2023

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

PATCH 1/1 media: ivtv: Fix exception handling in ivtvfb_init_vidmode()

From: Markus Elfring <[email protected]>
Date: Wed, 24 May 2023 08:30:10 +0200

The exception handling was incomplete.

Call also the function “fb_dealloc_cmap” after a call of the function “kmalloc_array” failed here.

Fixes 32db77545281 ("V4L/DVB (5902): Add ivtv-fb framebuffer driver.")
---
 drivers/media/pci/ivtv/ivtvfb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/pci/ivtv/ivtvfb.c +1 -0
index 0aeb9daaee4c..7d6a8065220c 100644
@@ -1073,6 +1073,7 @@ static int ivtvfb_init_vidmode(struct ivtv *itv)
 
 	if (!oi->ivtvfb_info.pseudo_palette) {
 		IVTVFB_ERR("abort, unable to alloc pseudo palette\n");
+		fb_dealloc_cmap(&oi->ivtvfb_info.cmap);
 		return -ENOMEM;
 	}
 

--
2.40.1