ionic: no devlink_unregister if not registered
authorShannon Nelson <snelson@pensando.io>
Tue, 12 Oct 2021 23:15:20 +0000 (16:15 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 13 Oct 2021 00:39:33 +0000 (17:39 -0700)
Don't try to unregister the devlink if it hasn't been registered
yet.  This bit of error cleanup code got missed in the recent
devlink registration changes.

Fixes: 7911c8bd546f ("ionic: Move devlink registration to be last devlink command")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20211012231520.72582-1-snelson@pensando.io
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/pensando/ionic/ionic_devlink.c

index 2267da9..4297ed9 100644 (file)
@@ -87,7 +87,6 @@ int ionic_devlink_register(struct ionic *ionic)
        err = devlink_port_register(dl, &ionic->dl_port, 0);
        if (err) {
                dev_err(ionic->dev, "devlink_port_register failed: %d\n", err);
-               devlink_unregister(dl);
                return err;
        }