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/serial/io_edgeport.c | |
parent | 6fd19f4b55f7fd1c9d8650bd7f8df2c81b69c5ca (diff) |
[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/serial/io_edgeport.c')
-rw-r--r-- | drivers/usb/serial/io_edgeport.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index e35b5adcd5f..04bfe279d76 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -951,9 +951,7 @@ static void edge_bulk_out_cmd_callback (struct urb *urb, struct pt_regs *regs) /* clean up the transfer buffer */ - if (urb->transfer_buffer != NULL) { - kfree(urb->transfer_buffer); - } + kfree(urb->transfer_buffer); /* Free the command urb */ usb_free_urb (urb); @@ -1266,16 +1264,12 @@ static void edge_close (struct usb_serial_port *port, struct file * filp) if (edge_port->write_urb) { /* if this urb had a transfer buffer already (old transfer) free it */ - if (edge_port->write_urb->transfer_buffer != NULL) { - kfree(edge_port->write_urb->transfer_buffer); - } - usb_free_urb (edge_port->write_urb); + kfree(edge_port->write_urb->transfer_buffer); + usb_free_urb(edge_port->write_urb); edge_port->write_urb = NULL; } - if (edge_port->txfifo.fifo) { - kfree(edge_port->txfifo.fifo); - edge_port->txfifo.fifo = NULL; - } + kfree(edge_port->txfifo.fifo); + edge_port->txfifo.fifo = NULL; dbg("%s exited", __FUNCTION__); } @@ -1419,11 +1413,9 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge // get a pointer to the write_urb urb = edge_port->write_urb; - /* if this urb had a transfer buffer already (old transfer) free it */ - if (urb->transfer_buffer != NULL) { - kfree(urb->transfer_buffer); - urb->transfer_buffer = NULL; - } + /* make sure transfer buffer is freed */ + kfree(urb->transfer_buffer); + urb->transfer_buffer = NULL; /* build the data header for the buffer and port that we are about to send out */ count = fifo->count; |