USB: fix use after free in wacom_sys.c
authorEric Sesterhenn <snakebyte@gmx.de>
Wed, 4 Oct 2006 16:56:44 +0000 (09:56 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Oct 2006 21:46:30 +0000 (14:46 -0700)
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=3D3bea733ab21247290bd552dd6a2cd3049af9adef
Found by coverity (cid #1441)

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: "Ping Cheng" <pingc@wacom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/input/wacom_sys.c

index 31379b89c3392b3f19c9ab71efcbe4ae5737d922..3498b893b53b62b6a792ddebcceafcb0ab5e890d 100644 (file)
@@ -282,8 +282,8 @@ static void wacom_disconnect(struct usb_interface *intf)
                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);
        }
 }