Skip to contentSkip to conversation

fm801_gp_probe: fix use after free

PATCH New Adrian Bunk 1 participant 1 message Dec 12, 2004 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fm801_gp_probe: fix use after free

The patch below by "Petri T. Koistinen" <[email protected]> in Rusty's trivial patches is IMHO a candidate for 2.6.10 .

drivers/input/gameport/fm801-gp.c +1 -1
@@ -98,8 +98,8 @@ static int __devinit fm801_gp_probe(stru
 	pci_enable_device(pci);
 	gp->gameport.io = pci_resource_start(pci, 0);
 	if ((gp->res_port = request_region(gp->gameport.io, 0x10, "FM801 GP")) == NULL) {
-		kfree(gp);
 		printk("unable to grab region 0x%x-0x%x\n", gp->gameport.io, gp->gameport.io + 0x0f);
+		kfree(gp);
 		return -1;
 	}