Skip to content

Commit

Permalink
gianfar: Handle error code at MAC address change
Browse files Browse the repository at this point in the history
Handle return error code of eth_mac_addr();

Fixes: 3d23a05 ("gianfar: Enable changing mac addr when if up")
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Claudiu Manoil authored and David S. Miller committed Mar 29, 2021
1 parent 6341576 commit bff5b62
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/ethernet/freescale/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,11 @@ static void gfar_set_mac_for_addr(struct net_device *dev, int num,

static int gfar_set_mac_addr(struct net_device *dev, void *p)
{
eth_mac_addr(dev, p);
int ret;

ret = eth_mac_addr(dev, p);
if (ret)
return ret;

gfar_set_mac_for_addr(dev, 0, dev->dev_addr);

Expand Down

0 comments on commit bff5b62

Please sign in to comment.