staging: ks7010: use ether_addr_copy to copy ethernet address sa_data
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Fri, 4 May 2018 04:16:30 +0000 (06:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 May 2018 01:58:39 +0000 (18:58 -0700)
Use ether_addr_copy kernel function to copy an ethernet address
instead of a simple memcpy with ETH_ALEN size.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c

index 8cd3dac4fcd3df6261764c9008ad89f8b42a4fbc..00d631828436dc68d326caf1ff64d34ce66098ab 100644 (file)
@@ -151,8 +151,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info *ap_info)
        wrqu.data.flags = 0;
        wrqu.ap_addr.sa_family = ARPHRD_ETHER;
        if (is_connect_status(priv->connect_status)) {
-               memcpy(wrqu.ap_addr.sa_data,
-                      priv->current_ap.bssid, ETH_ALEN);
+               ether_addr_copy(wrqu.ap_addr.sa_data, priv->current_ap.bssid);
                netdev_dbg(priv->net_dev,
                           "IWEVENT: connect bssid=%pM\n", wrqu.ap_addr.sa_data);
                wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL);