Skip to content

Commit 231e341

Browse files
qzhuo2aegl
authored andcommitted
EDAC/ie31200: Fix the error path order of ie31200_init()
The error path order of ie31200_init() is incorrect, fix it. Fixes: 709ed1b ("EDAC/ie31200: Fallback if host bridge device is already initialized") Signed-off-by: Qiuxu Zhuo <[email protected]> Signed-off-by: Tony Luck <[email protected]> Tested-by: Gary Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3427bef commit 231e341

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/edac/ie31200_edac.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ static int __init ie31200_init(void)
619619

620620
pci_rc = pci_register_driver(&ie31200_driver);
621621
if (pci_rc < 0)
622-
goto fail0;
622+
return pci_rc;
623623

624624
if (!mci_pdev) {
625625
ie31200_registered = 0;
@@ -630,24 +630,26 @@ static int __init ie31200_init(void)
630630
if (mci_pdev)
631631
break;
632632
}
633+
633634
if (!mci_pdev) {
634635
edac_dbg(0, "ie31200 pci_get_device fail\n");
635636
pci_rc = -ENODEV;
636-
goto fail1;
637+
goto fail0;
637638
}
639+
638640
pci_rc = ie31200_init_one(mci_pdev, &ie31200_pci_tbl[i]);
639641
if (pci_rc < 0) {
640642
edac_dbg(0, "ie31200 init fail\n");
641643
pci_rc = -ENODEV;
642644
goto fail1;
643645
}
644646
}
645-
return 0;
646647

648+
return 0;
647649
fail1:
648-
pci_unregister_driver(&ie31200_driver);
649-
fail0:
650650
pci_dev_put(mci_pdev);
651+
fail0:
652+
pci_unregister_driver(&ie31200_driver);
651653

652654
return pci_rc;
653655
}

0 commit comments

Comments
 (0)