--- a/ipq806x/nss_gmac_ctrl.c +++ b/ipq806x/nss_gmac_ctrl.c @@ -992,7 +992,7 @@ static int32_t nss_gmac_of_get_pdata(str return -EFAULT; } maddr = (uint8_t *)of_get_mac_address(np); - if (maddr) + if (!IS_ERR_OR_NULL(maddr)) memcpy(gmaccfg->mac_addr, maddr, ETH_ALEN); if (of_address_to_resource(np, 0, &memres_devtree) != 0)