mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 07:34:03 -04:00
staging: wfx: fix Oops when CONFIG_OF_NET is not set
In most case, of_get_mac_address() return NULL in case of error. However, if CONFIG_OF_NET is not set, it return -ENODEV. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20191017093954.657-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8008d9e7dd
commit
4e4f5e6fef
@@ -407,7 +407,7 @@ int wfx_probe(struct wfx_dev *wdev)
|
||||
for (i = 0; i < ARRAY_SIZE(wdev->addresses); i++) {
|
||||
eth_zero_addr(wdev->addresses[i].addr);
|
||||
macaddr = of_get_mac_address(wdev->dev->of_node);
|
||||
if (macaddr) {
|
||||
if (!IS_ERR_OR_NULL(macaddr)) {
|
||||
ether_addr_copy(wdev->addresses[i].addr, macaddr);
|
||||
wdev->addresses[i].addr[ETH_ALEN - 1] += i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user