]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb464694a13fae3aa21e3d8e8484c20dff80db16a
tree7cf0213b49b6c2672068a221646dfcaec7a524ce
parentf77de778c925b81c7c2d295eb42661e9f8c9a879
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: 2214a12665a2 ("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