diff options
author | Crag.Wang <crag.wang@dell.com> | 2019-04-22 13:03:43 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-22 22:14:43 -0700 |
commit | a6cbcb7793596eb8b8dd9564e534c5cfc0a4fdbc (patch) | |
tree | ba27ae3125487e31260e3d63f44b332651e7ccbc /drivers/net/usb | |
parent | 6f97955fd2741ac4d73c1ba328870253ded680c8 (diff) |
r8152: sync sa_family with the media type of network device
Without this patch the socket address family sporadically gets wrong
value ends up the dev_set_mac_address() fails to set the desired MAC
address.
Fixes: 25766271e42f ("r8152: Refresh MAC address during USBDEVFS_RESET")
Signed-off-by: Crag.Wang <crag.wang@dell.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-By: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/r8152.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 6d63dcb73b26..b01bfa63860d 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -1225,6 +1225,8 @@ static int determine_ethernet_addr(struct r8152 *tp, struct sockaddr *sa) struct net_device *dev = tp->netdev; int ret; + sa->sa_family = dev->type; + if (tp->version == RTL_VER_01) { ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data); } else { |