[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 ===================================================================
This commit is contained in:
@@ -309,7 +309,7 @@ static int bluetooth_ctrl_msg (struct usb_bluetooth *bluetooth, int request, int
|
||||
}
|
||||
}
|
||||
if (urb->transfer_buffer_length < len) {
|
||||
kfree (urb->transfer_buffer);
|
||||
kfree(urb->transfer_buffer);
|
||||
urb->transfer_buffer = kmalloc (len, GFP_KERNEL);
|
||||
if (urb->transfer_buffer == NULL) {
|
||||
err ("%s - out of memory", __FUNCTION__);
|
||||
@@ -535,7 +535,7 @@ static int bluetooth_write (struct tty_struct * tty, const unsigned char *buf, i
|
||||
}
|
||||
|
||||
exit:
|
||||
kfree (temp_buffer);
|
||||
kfree(temp_buffer);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
Reference in New Issue
Block a user