octeon_ep: ensure get mac address successfully before eth_hw_addr_set()
authorZiyang Xuan <william.xuanziyang@huawei.com>
Fri, 11 Nov 2022 07:09:35 +0000 (15:09 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Nov 2022 10:55:43 +0000 (10:55 +0000)
commit848ffce2f0c93f3481052340a919123a21f808b6
tree7cf0213b49b6c2672068a221646dfcaec7a524ce
parente4041be97b15302ebfffda8bbd45f3b2d096048f
octeon_ep: ensure get mac address successfully before eth_hw_addr_set()

octep_get_mac_addr() can fail because send mbox message failed. If this
happens, octep_dev->mac_addr will be zero. It should not continue to
initialize. Add exception handling for octep_get_mac_addr() to fix it.

Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization")
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeon_ep/octep_main.c