aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.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/ftdi_sio.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/ftdi_sio.c')
-rw-r--r--drivers/usb/serial/ftdi_sio.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 4afd905fe2fe..4c788c767a97 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1347,9 +1347,7 @@ static int ftdi_common_startup (struct usb_serial *serial)
1347 priv->flags = ASYNC_LOW_LATENCY; 1347 priv->flags = ASYNC_LOW_LATENCY;
1348 1348
1349 /* Increase the size of read buffers */ 1349 /* Increase the size of read buffers */
1350 if (port->bulk_in_buffer) { 1350 kfree(port->bulk_in_buffer);
1351 kfree (port->bulk_in_buffer);
1352 }
1353 port->bulk_in_buffer = kmalloc (BUFSZ, GFP_KERNEL); 1351 port->bulk_in_buffer = kmalloc (BUFSZ, GFP_KERNEL);
1354 if (!port->bulk_in_buffer) { 1352 if (!port->bulk_in_buffer) {
1355 kfree (priv); 1353 kfree (priv);
@@ -1365,10 +1363,8 @@ static int ftdi_common_startup (struct usb_serial *serial)
1365 usb_free_urb (port->write_urb); 1363 usb_free_urb (port->write_urb);
1366 port->write_urb = NULL; 1364 port->write_urb = NULL;
1367 } 1365 }
1368 if (port->bulk_out_buffer) { 1366 kfree(port->bulk_out_buffer);
1369 kfree (port->bulk_out_buffer); 1367 port->bulk_out_buffer = NULL;
1370 port->bulk_out_buffer = NULL;
1371 }
1372 1368
1373 usb_set_serial_port_data(serial->port[0], priv); 1369 usb_set_serial_port_data(serial->port[0], priv);
1374 1370