Skip to contentSkip to conversation

amd64_edac: fix a wrong goto clause in amd64_edac.c

PATCH In review Li Hong 3 participants 4 messages Oct 19, 2009 – Oct 20, 2009

Subsystems (2)
lore
Share & tools
lore

Li Hong

author
#0 lore raw

PATCH 1/1 amd64_edac: fix a wrong goto clause in amd64_edac.c

In amd64_edac_init(void) in amd64_edac.c, cache_k8_northbridges() is called before pci_register_driver. If it fails, should exit with err directly.

---
 drivers/edac/amd64_edac.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/edac/amd64_edac.c +1 -3
index d4560d9..3ee539a 100644
@@ -3163,7 +3163,7 @@ static int __init amd64_edac_init(void)
 	opstate_init();
 
 	if (cache_k8_northbridges() < 0)
-		goto err_exit;
+		return err;
 
 	err = pci_register_driver(&amd64_pci_driver);
 	if (err)
@@ -3189,8 +3189,6 @@ static int __init amd64_edac_init(void)
 
 err_2nd_stage:
 	debugf0("2nd stage failed\n");
-
-err_exit:
 	pci_unregister_driver(&amd64_pci_driver);
 
 	return err;
Signature · 1 line
1.6.0.4
#1 lore raw
Quoted 4 lines · Li Hong

In amd64_edac_init(void) in amd64_edac.c, cache_k8_northbridges() is called before pci_register_driver. If it fails, should exit with err directly.

Thanks, queued for the next .32 update.

By the way, is this something you've caught by looking at the code or is it a condition you're hitting on a real system with a specific workload? If it is the second, I'd like to know more wrt to why cache_k8_northbridges() is failing in your particular case.

Thanks.

Signature · 8 lines
Regards/Gruss,
Boris.

Operating | Advanced Micro Devices GmbH
  System  | Karl-Hammerschmidt-Str. 34, 85609 Dornach b. München, Germany
 Research | Geschäftsführer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
  Center  | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
  (OSRC)  | Registergericht München, HRB Nr. 43632
Acked-by on v1 1/1
#3 lore raw
In reply to Li Hong
Quoted 10 lines · Li Hong

From: Li Hong <[email protected]>
Subject: [PATCH] amd64_edac: fix a wrong goto clause in amd64_edac.c
To: "Borislav Petkov" <[email protected]>, "Doug Thompson" <[email protected]>, [email protected]
Date: Monday, October 19, 2009, 2:33 AM
In amd64_edac_init(void) in
amd64_edac.c, cache_k8_northbridges() is called
before pci_register_driver. If it fails, should exit with
err directly.

Quoted 35 lines
---
 drivers/edac/amd64_edac.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/edac/amd64_edac.c +1 -1
index d4560d9..3ee539a 100644
@@ -3163,7 +3163,7 @@ static int __init
 amd64_edac_init(void)
     opstate_init();
 
     if (cache_k8_northbridges() < 0)
-        goto err_exit;
+        return err;
 
     err =

pci_register_driver(&amd64_pci_driver);
    if (err)

drivers/edac/amd64_edac.c +0 -2
@@ -3189,8 +3189,6 @@ static int __init
 amd64_edac_init(void)
 
 err_2nd_stage:
     debugf0("2nd stage failed\n");
-
-err_exit:
    
 pci_unregister_driver(&amd64_pci_driver);

    return err;

Signature · 1 line
1.6.0.4
author
#2 lore raw
In reply to Borislav Petkov

Just caught by looking at the code. Thanks.

2009/10/19 Borislav Petkov <[email protected]>:

Quoted 26 lines · Li Hong
Quoted 4 lines

In amd64_edac_init(void) in amd64_edac.c, cache_k8_northbridges() is called before pci_register_driver. If it fails, should exit with err directly.

Thanks, queued for the next .32 update.

By the way, is this something you've caught by looking at the code or is it a condition you're hitting on a real system with a specific workload? If it is the second, I'd like to know more wrt to why cache_k8_northbridges() is failing in your particular case.

Thanks.

--
Regards/Gruss,
Boris.

Operating | Advanced Micro Devices GmbH

 System  | Karl-Hammerschmidt-Str. 34, 85609 Dornach b. München, Germany
 Research | Geschäftsführer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
 Center  | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
 (OSRC)  | Registergericht München, HRB Nr. 43632