i7core_edac: don't free on success
authorTony Luck <tony.luck@intel.com>
Tue, 18 May 2010 13:53:25 +0000 (10:53 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 18 May 2010 17:47:31 +0000 (14:47 -0300)
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/edac/i7core_edac.c

index 82acfbd..3e2b537 100644 (file)
@@ -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;
 }