aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/edac/edac_mc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 616d90bcb3a4..9037ffa100d5 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -419,14 +419,16 @@ error:
419 kfree(mci->dimms); 419 kfree(mci->dimms);
420 } 420 }
421 if (mci->csrows) { 421 if (mci->csrows) {
422 for (chn = 0; chn < tot_channels; chn++) { 422 for (row = 0; row < tot_csrows; row++) {
423 csr = mci->csrows[chn]; 423 csr = mci->csrows[row];
424 if (csr) { 424 if (csr) {
425 for (chn = 0; chn < tot_channels; chn++) 425 if (csr->channels) {
426 kfree(csr->channels[chn]); 426 for (chn = 0; chn < tot_channels; chn++)
427 kfree(csr->channels[chn]);
428 kfree(csr->channels);
429 }
427 kfree(csr); 430 kfree(csr);
428 } 431 }
429 kfree(mci->csrows[i]);
430 } 432 }
431 kfree(mci->csrows); 433 kfree(mci->csrows);
432 } 434 }