mirror of https://gitee.com/openkylin/linux.git
staging: serqt_usb2: Remove NULL check before kfree
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>
This commit is contained in:
parent
b7977fa250
commit
ef055f1000
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue