From: Heinrich Schuchardt Date: Sun, 19 Apr 2020 10:11:12 +0000 (+0200) Subject: usb: ether: avoid NULL check before free() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=3c425fc0ef4de31d350695c74db7a3d6be0379b6;p=u-boot.git usb: ether: avoid NULL check before free() free() checks if its argument is NULL. Do not duplicate this check. Signed-off-by: Heinrich Schuchardt --- diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index a118283984..8533abfd93 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -2472,8 +2472,7 @@ static int _usb_eth_send(struct ether_priv *priv, void *packet, int length) } usb_gadget_handle_interrupts(0); } - if (rndis_pkt) - free(rndis_pkt); + free(rndis_pkt); return 0; drop: