summaryrefslogtreecommitdiff
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-04-19 04:39:34 +0400
committerGreg K-H <gregkh@suse.de>2005-04-19 04:39:34 +0400
commit1bc3c9e1e44c2059fe2ffa6ff70ad0a925d7b05f (patch)
tree0bc14ec53acf3b4c08a9995c7ea335e236435558 /drivers/usb/core
parent6fd19f4b55f7fd1c9d8650bd7f8df2c81b69c5ca (diff)
downloadlinux-1bc3c9e1e44c2059fe2ffa6ff70ad0a925d7b05f.tar.xz
[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')
-rw-r--r--drivers/usb/core/devices.c7
-rw-r--r--drivers/usb/core/hub.c16
2 files changed, 8 insertions, 15 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index b87608b7051b..ef0b35731ff0 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -637,11 +637,8 @@ static int usb_device_open(struct inode *inode, struct file *file)
static int usb_device_release(struct inode *inode, struct file *file)
{
- if (file->private_data) {
- kfree(file->private_data);
- file->private_data = NULL;
- }
-
+ kfree(file->private_data);
+ file->private_data = NULL;
return 0;
}
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