OpenCloudOS-Kernel/drivers/net/usb
Anant Thazhemadam 60f1626f0f net: usb: rtl8150: don't incorrectly assign random MAC addresses
In set_ethernet_addr(), if get_registers() succeeds, the ethernet address
that was read must be copied over. Otherwise, a random ethernet address
must be assigned.

get_registers() returns 0 if successful, and negative error number
otherwise. However, in set_ethernet_addr(), this return value is
incorrectly checked.

Since this return value will never be equal to sizeof(node_id), a
random MAC address will always be generated and assigned to the
device; even in cases when get_registers() is successful.

Correctly modifying the condition that checks if get_registers() was
successful or not fixes this problem, and copies the ethernet address
appropriately.

Fixes: b2a0f274e3 ("net: rtl8150: Use the new usb control message API.")
Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
Link: https://lore.kernel.org/r/20201011173030.141582-1-anant.thazhemadam@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-10-18 12:57:30 -07:00
..
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-09-04 21:28:59 -07:00
Makefile net: usb: aqc111: Driver skeleton for Aquantia AQtion USB to 5GbE 2018-11-27 15:46:06 -08:00
aqc111.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
aqc111.h net: usb: aqc111: Use the correct style for SPDX License Identifier 2019-11-27 11:27:01 -08:00
asix.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
asix_common.c net: usb: Fix uninit-was-stored issue in asix_read_phy_addr() 2020-08-27 07:37:19 -07:00
asix_devices.c net: usb: asix: init MAC address buffers 2019-07-02 15:24:48 -07:00
ax88172a.c ax88172a: fix ax88172a_unbind() failures 2020-07-15 18:26:29 -07:00
ax88179_178a.c net: usb: ax88179_178a: add MCT usb 3.0 adapter 2020-09-28 18:39:05 -07:00
catc.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
cdc-phonet.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
cdc_eem.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
cdc_ether.c net: cdc_ether: export usbnet_cdc_update_filter 2020-07-17 12:42:47 -07:00
cdc_mbim.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cdc_ncm.c net: cdc_ncm: hook into set_rx_mode to admit multicast traffic 2020-07-17 12:42:47 -07:00
cdc_subset.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
ch9200.c net: ch9200: remove unnecessary return 2020-01-07 13:30:36 -08:00
cx82310_eth.c cx82310_eth: use netdev_err instead of dev_err 2020-10-12 09:46:40 -07:00
dm9601.c net: usb: dm9601: Add USB ID of Keenetic Plus DSL 2020-09-01 15:35:23 -07:00
gl620a.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
hso.c usb: hso: remove bogus check for EINPROGRESS 2020-08-05 17:43:39 -07:00
huawei_cdc_ncm.c net: huawei_cdc_ncm: remove redundant assignment to variable ret 2020-05-10 11:13:07 -07:00
int51x1.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
ipheth.c usbnet: ipheth: fix ipheth_tx()'s return type 2020-06-28 20:52:53 -07:00
kalmia.c net: kalmia: fix memory leaks 2019-08-18 13:03:21 -07:00
kaweth.c net: usb: kaweth: Remove last user of kaweth_control() 2020-09-29 14:02:54 -07:00
lan78xx.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
lan78xx.h net: lan78xx: Switch to SPDX identifier 2018-09-05 22:20:45 -07:00
lg-vl600.c net: usb: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:03 -07:00
mcs7830.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
net1080.c net: usb: net1080: Remove in_interrupt() comment 2020-09-29 14:02:54 -07:00
pegasus.c USB/PHY/Thunderbolt driver patches for 5.10-rc1 2020-10-15 09:51:18 -07:00
pegasus.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
plusb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
qmi_wwan.c net: usb: qmi_wwan: use new function dev_fetch_sw_netstats 2020-10-13 17:33:48 -07:00
r8152.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
rndis_host.c rndis_host: increase sleep time in the query-response loop 2020-09-14 14:39:59 -07:00
rtl8150.c net: usb: rtl8150: don't incorrectly assign random MAC addresses 2020-10-18 12:57:30 -07:00
sierra_net.c net: sierra_net: Remove unused inline function 2020-05-05 12:07:43 -07:00
smsc75xx.c net/smscx5xx: change to of_get_mac_address() eth_platform_get_mac_address() 2020-10-02 15:21:17 -07:00
smsc75xx.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
smsc95xx.c net/smscx5xx: change to of_get_mac_address() eth_platform_get_mac_address() 2020-10-02 15:21:17 -07:00
smsc95xx.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
sr9700.c drivers: net: Remove unnecessary semicolon 2019-03-01 23:13:49 -08:00
sr9700.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sr9800.c net: usb: sr9800: fix uninitialized local variable 2019-10-15 21:02:12 -07:00
sr9800.h
usbnet.c net: usbnet: use new function dev_fetch_sw_netstats 2020-10-13 17:33:49 -07:00
zaurus.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00