1
0
Fork 0

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: 25766271e4 ("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>
hifive-unleashed-5.2
Crag.Wang 2019-04-22 13:03:43 +08:00 committed by David S. Miller
parent 6f97955fd2
commit a6cbcb7793
1 changed files with 2 additions and 0 deletions

View File

@ -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 {