diff options
author | Jesper Juhl <juhl-lkml@dif.dk> | 2005-04-18 17:39:34 -0700 |
---|---|---|
committer | Greg K-H <gregkh@suse.de> | 2005-04-18 17:39:34 -0700 |
commit | 1bc3c9e1e44c2059fe2ffa6ff70ad0a925d7b05f (patch) | |
tree | 0bc14ec53acf3b4c08a9995c7ea335e236435558 /drivers/usb/core/hub.c | |
parent | 6fd19f4b55f7fd1c9d8650bd7f8df2c81b69c5ca (diff) | |
download | talos-obmc-linux-1bc3c9e1e44c2059fe2ffa6ff70ad0a925d7b05f.tar.gz talos-obmc-linux-1bc3c9e1e44c2059fe2ffa6ff70ad0a925d7b05f.zip |
[PATCH] USB: kfree cleanup for drivers/usb/* - no need to check for NULL
Get rid of a bunch of redundant NULL pointer checks in drivers/usb/*,
there's no need to check a pointer for NULL before calling kfree() on it.
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Index: gregkh-2.6/drivers/usb/class/audio.c
===================================================================
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 15ac4d168862..d2d648ee8640 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -381,7 +381,7 @@ static void hub_tt_kevent (void *arg) dev_err (&hdev->dev, "clear tt %d (%04x) error %d\n", clear->tt, clear->devinfo, status); - kfree (clear); + kfree(clear); } spin_unlock_irqrestore (&hub->tt.lock, flags); } @@ -728,15 +728,11 @@ static void hub_disconnect(struct usb_interface *intf) list_del_init(&hub->event_list); spin_unlock_irq(&hub_event_lock); - if (hub->descriptor) { - kfree(hub->descriptor); - hub->descriptor = NULL; - } + kfree(hub->descriptor); + hub->descriptor = NULL; - if (hub->status) { - kfree(hub->status); - hub->status = NULL; - } + kfree(hub->status); + hub->status = NULL; if (hub->buffer) { usb_buffer_free(hdev, sizeof(*hub->buffer), hub->buffer, @@ -2354,7 +2350,7 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) schedule_work (&hub->leds); } } - kfree (qual); + kfree(qual); } static unsigned |