Skip to content

Commit

Permalink
staging: serqt_usb2: Remove NULL check before kfree
Browse files Browse the repository at this point in the history
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Ilia Mirkin authored and Greg Kroah-Hartman committed Mar 14, 2011
1 parent b7977fa commit ef055f1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/serqt_usb2/serqt_usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,8 +1098,7 @@ static void qt_close(struct usb_serial_port *port)

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

Expand Down

0 comments on commit ef055f1

Please sign in to comment.