Skip to contentSkip to conversation

drivers/input/gameport/gameport.c: fix a memory leak

PATCH In review Adrian Bunk 2 participants 2 messages Mar 11, 2006 – Mar 14, 2006 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/input/gameport/gameport.c: fix a memory leak

This patch fixes a memory leak found by the Coverity checker.

drivers/input/gameport/gameport.c renamed from drivers/input/gameport/gameport.c.old +1 -0
@@ -266,6 +266,7 @@ static void gameport_queue_event(void *o
 	if ((event = kmalloc(sizeof(struct gameport_event), GFP_ATOMIC))) {
 		if (!try_module_get(owner)) {
 			printk(KERN_WARNING "gameport: Can't get module reference, dropping event %d\n", event_type);
+			kfree(event);
 			goto out;
 		}
 
#1 lore raw
Quoted 2 lines · Adrian Bunk

This patch fixes a memory leak found by the Coverity checker.

Both patches applied, thank you Adrian.

Because the leak is very hard to trigger it will not be merged until 2.6.17 opens up.

Signature · 1 line
Dmitry