usb: ether: avoid NULL check before free()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 19 Apr 2020 10:11:12 +0000 (12:11 +0200)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Tue, 28 Apr 2020 11:52:52 +0000 (13:52 +0200)
free() checks if its argument is NULL. Do not duplicate this check.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
drivers/usb/gadget/ether.c

index a118283984c2d2e58226a93a2d26c11f58f71b8d..8533abfd9301835caa591727ae6395f2d8e67460 100644 (file)
@@ -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: