aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/io_edgeport.c
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-04-18 20:39:34 -0400
committerGreg K-H <gregkh@suse.de>2005-04-18 20:39:34 -0400
commit1bc3c9e1e44c2059fe2ffa6ff70ad0a925d7b05f (patch)
tree0bc14ec53acf3b4c08a9995c7ea335e236435558 /drivers/usb/serial/io_edgeport.c
parent6fd19f4b55f7fd1c9d8650bd7f8df2c81b69c5ca (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.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index e35b5adcd5fe..04bfe279d763 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)
951 951
952 952
953 /* clean up the transfer buffer */ 953 /* clean up the transfer buffer */
954 if (urb->transfer_buffer != NULL) { 954 kfree(urb->transfer_buffer);
955 kfree(urb->transfer_buffer);
956 }
957 955
958 /* Free the command urb */ 956 /* Free the command urb */
959 usb_free_urb (urb); 957 usb_free_urb (urb);
@@ -1266,16 +1264,12 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
1266 1264
1267 if (edge_port->write_urb) { 1265 if (edge_port->write_urb) {
1268 /* if this urb had a transfer buffer already (old transfer) free it */ 1266 /* if this urb had a transfer buffer already (old transfer) free it */
1269 if (edge_port->write_urb->transfer_buffer != NULL) { 1267 kfree(edge_port->write_urb->transfer_buffer);
1270 kfree(edge_port->write_urb->transfer_buffer); 1268 usb_free_urb(edge_port->write_urb);
1271 }
1272 usb_free_urb (edge_port->write_urb);
1273 edge_port->write_urb = NULL; 1269 edge_port->write_urb = NULL;
1274 } 1270 }
1275 if (edge_port->txfifo.fifo) { 1271 kfree(edge_port->txfifo.fifo);
1276 kfree(edge_port->txfifo.fifo); 1272 edge_port->txfifo.fifo = NULL;
1277 edge_port->txfifo.fifo = NULL;
1278 }
1279 1273
1280 dbg("%s exited", __FUNCTION__); 1274 dbg("%s exited", __FUNCTION__);
1281} 1275}
@@ -1419,11 +1413,9 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
1419 // get a pointer to the write_urb 1413 // get a pointer to the write_urb
1420 urb = edge_port->write_urb; 1414 urb = edge_port->write_urb;
1421 1415
1422 /* if this urb had a transfer buffer already (old transfer) free it */ 1416 /* make sure transfer buffer is freed */
1423 if (urb->transfer_buffer != NULL) { 1417 kfree(urb->transfer_buffer);
1424 kfree(urb->transfer_buffer); 1418 urb->transfer_buffer = NULL;
1425 urb->transfer_buffer = NULL;
1426 }
1427 1419
1428 /* build the data header for the buffer and port that we are about to send out */ 1420 /* build the data header for the buffer and port that we are about to send out */
1429 count = fifo->count; 1421 count = fifo->count;