staging: unisys: unregister netdev when create debugfs fails

Noticed we were not unregistering the netdevice if we failed to
create the debugfs entries. This patch fixes that problem.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
David Kershner 2015-09-04 12:01:29 -04:00 committed by Greg Kroah-Hartman
parent dd3afa57c5
commit 5b12100a53
1 changed files with 4 additions and 1 deletions

View File

@ -1924,13 +1924,16 @@ static int visornic_probe(struct visor_device *dev)
"%s debugfs_create_dir %s failed\n", "%s debugfs_create_dir %s failed\n",
__func__, netdev->name); __func__, netdev->name);
err = -ENOMEM; err = -ENOMEM;
goto cleanup_xmit_cmdrsp; goto cleanup_register_netdev;
} }
dev_info(&dev->device, "%s success netdev=%s\n", dev_info(&dev->device, "%s success netdev=%s\n",
__func__, netdev->name); __func__, netdev->name);
return 0; return 0;
cleanup_register_netdev:
unregister_netdev(netdev);
cleanup_napi_add: cleanup_napi_add:
del_timer_sync(&devdata->irq_poll_timer); del_timer_sync(&devdata->irq_poll_timer);
netif_napi_del(&devdata->napi); netif_napi_del(&devdata->napi);