Procházet zdrojové kódy

usb: ether: avoid NULL check before free()

free() checks if its argument is NULL. Do not duplicate this check.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Heinrich Schuchardt před 4 roky
rodič
revize
3c425fc0ef
1 změnil soubory, kde provedl 1 přidání a 2 odebrání
  1. 1 2
      drivers/usb/gadget/ether.c

+ 1 - 2
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: