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>
This commit is contained in:
parent
6f97955fd2
commit
a6cbcb7793
@ -1225,6 +1225,8 @@ static int determine_ethernet_addr(struct r8152 *tp, struct sockaddr *sa)
|
|||||||
struct net_device *dev = tp->netdev;
|
struct net_device *dev = tp->netdev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
sa->sa_family = dev->type;
|
||||||
|
|
||||||
if (tp->version == RTL_VER_01) {
|
if (tp->version == RTL_VER_01) {
|
||||||
ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data);
|
ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user