staging: ks7010: remove unnecessary address check
authorTobin C. Harding <me@tobin.cc>
Thu, 27 Apr 2017 01:25:12 +0000 (11:25 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Apr 2017 09:45:49 +0000 (11:45 +0200)
Currently source and destination ethernet addresses are checked twice,
once in hostif_data_indication() and then again in
hostif_data_indication_wpa(). The second of these functions is called
from the first right after the address check is done. This check is a
duplicate and is unnecessary.

Remove unnecessary duplicate address check.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c

index 7151f16e2f9c7f33dd931af10bbbc177bb41e8c6..2216409bcb3d6c0e738d9bf62b96c0b12db955b1 100644 (file)
@@ -326,10 +326,6 @@ int hostif_data_indication_wpa(struct ks_wlan_private *priv,
        eth_hdr = (struct ether_hdr *)(priv->rxp);
        eth_proto = ntohs(eth_hdr->h_proto);
 
-       /* source address check */
-       if (memcmp(&eth_hdr->h_source[0], &priv->eth_addr[0], ETH_ALEN) == 0)
-               return 0;
-
        if (eth_hdr->h_dest_snap != eth_hdr->h_source_snap) {
                DPRINTK(1, "invalid data format\n");
                priv->nstats.rx_errors++;