Browse Source

i7core_edac: don't free on success

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tony Luck 15 years ago
parent
commit
d4d1ef4515
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/edac/i7core_edac.c

+ 2 - 1
drivers/edac/i7core_edac.c

@@ -1856,7 +1856,8 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev,
 	}
 
 fail:
-	edac_mc_free(mci);
+	if (rc < 0)
+		edac_mc_free(mci);
 	return rc;
 }