Skip to content

Commit

Permalink
usb: serial: Remove redundant NULL check before kfree
Browse files Browse the repository at this point in the history
kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
syamsidhardh authored and gregkh committed Mar 15, 2013
1 parent dad3cab commit ae8d487
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/serial/mos7840.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,8 +1252,7 @@ static void mos7840_close(struct usb_serial_port *port)

if (mos7840_port->write_urb) {
/* if this urb had a transfer buffer already (old tx) free it */
if (mos7840_port->write_urb->transfer_buffer != NULL)
kfree(mos7840_port->write_urb->transfer_buffer);
kfree(mos7840_port->write_urb->transfer_buffer);
usb_free_urb(mos7840_port->write_urb);
}

Expand Down

0 comments on commit ae8d487

Please sign in to comment.