Skip to contentSkip to conversation

Use after free in drivers/usb/input/wacom_sys.c

PATCH New Eric Sesterhenn 1 participant 1 message Oct 4, 2006 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use after free in drivers/usb/input/wacom_sys.c

hi,

the following commit added a use after free
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3bea733ab21247290bd552dd6a2cd3049af9adef
Found by coverity (cid #1441)

drivers/usb/input/wacom_sys.c renamed from drivers/usb/input/wacom_sys.c.orig +1 -1
@@ -285,8 +285,8 @@ static void wacom_disconnect(struct usb_
 		input_unregister_device(wacom->dev);
 		usb_free_urb(wacom->irq);
 		usb_buffer_free(interface_to_usbdev(intf), 10, wacom->wacom_wac->data, wacom->data_dma);
-		kfree(wacom);
 		kfree(wacom->wacom_wac);
+		kfree(wacom);
 	}
 }