summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2019-10-17 09:40:06 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-26 20:42:32 +0200
commit4e4f5e6fef21a574b4749a0fb5e96070eb03cb19 (patch)
treecfa7a14aba97a7d08a158243975d3f59e1275cc7 /drivers
parent8008d9e7ddf0b72ff0f879af0a3c48a1086b6250 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/wfx/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 3a43f190d96a..205b5bc8872e 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -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;
}