diff --git a/drivers/net/greth.c b/drivers/net/greth.c index f15c64f1cd38..fbeaf70d1727 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c @@ -1547,10 +1547,10 @@ static int __devinit greth_of_probe(struct platform_device *ofdev, const struct dev->netdev_ops = &greth_netdev_ops; dev->ethtool_ops = &greth_ethtool_ops; - if (register_netdev(dev)) { + err = register_netdev(dev); + if (err) { if (netif_msg_probe(greth)) dev_err(greth->dev, "netdevice registration failed.\n"); - err = -ENOMEM; goto error5; }