usb: legousbtower free kill urb cleanup
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>
Wed, 8 Nov 2006 14:36:14 +0000 (15:36 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Dec 2006 22:23:34 +0000 (14:23 -0800)
Hello,

- usb_free_urb() cleanup
- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/legousbtower.c

index f8611997bd77595b43c507c7cff812a40c3ec635..5dce797bddb7e2369ad41dc3f9bd1661718c201f 100644 (file)
@@ -317,12 +317,8 @@ static inline void tower_delete (struct lego_usb_tower *dev)
        tower_abort_transfers (dev);
 
        /* free data structures */
-       if (dev->interrupt_in_urb != NULL) {
-               usb_free_urb (dev->interrupt_in_urb);
-       }
-       if (dev->interrupt_out_urb != NULL) {
-               usb_free_urb (dev->interrupt_out_urb);
-       }
+       usb_free_urb(dev->interrupt_in_urb);
+       usb_free_urb(dev->interrupt_out_urb);
        kfree (dev->read_buffer);
        kfree (dev->interrupt_in_buffer);
        kfree (dev->interrupt_out_buffer);
@@ -502,15 +498,11 @@ static void tower_abort_transfers (struct lego_usb_tower *dev)
        if (dev->interrupt_in_running) {
                dev->interrupt_in_running = 0;
                mb();
-               if (dev->interrupt_in_urb != NULL && dev->udev) {
+               if (dev->udev)
                        usb_kill_urb (dev->interrupt_in_urb);
-               }
-       }
-       if (dev->interrupt_out_busy) {
-               if (dev->interrupt_out_urb != NULL && dev->udev) {
-                       usb_kill_urb (dev->interrupt_out_urb);
-               }
        }
+       if (dev->interrupt_out_busy && dev->udev)
+               usb_kill_urb(dev->interrupt_out_urb);
 
 exit:
        dbg(2, "%s: leave", __FUNCTION__);