USB: appletouch: fix atp_disconnect
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 19 Jul 2006 13:39:46 +0000 (15:39 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Aug 2006 21:06:06 +0000 (14:06 -0700)
appletouch uses urb->transfer_dma after having freed the urb, this shows
up only if the system is compiled with slab debugging. This patch fixes
it by reordering the free calls.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/input/appletouch.c

index 9e3f139033714b49c2c7ef101803d52a78e02112..044faa07e2976f49bf81bf8514f4c3b4575babbe 100644 (file)
@@ -597,9 +597,9 @@ static void atp_disconnect(struct usb_interface *iface)
        if (dev) {
                usb_kill_urb(dev->urb);
                input_unregister_device(dev->input);
-               usb_free_urb(dev->urb);
                usb_buffer_free(dev->udev, dev->datalen,
                                dev->data, dev->urb->transfer_dma);
+               usb_free_urb(dev->urb);
                kfree(dev);
        }
        printk(KERN_INFO "input: appletouch disconnected\n");