Merge tag 'edac_urgent_for_v6.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras

Pull EDAC fixes from Borislav Petkov:
 "Make sure the memory-mapped memory controller registers BAR gets
  unmapped when the driver memory allocation fails

  Fix that in both x38 and i3200 EDAC drivers as former has copied the
  bug from the latter, it looks like"

* tag 'edac_urgent_for_v6.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  EDAC/x38: Fix a resource leak in x38_probe1()
  EDAC/i3200: Fix a resource leak in i3200_probe1()
This commit is contained in:
Linus Torvalds
2026-01-18 11:39:56 -08:00
2 changed files with 12 additions and 8 deletions

View File

@@ -358,10 +358,11 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
layers[1].type = EDAC_MC_LAYER_CHANNEL;
layers[1].size = nr_channels;
layers[1].is_virt_csrow = false;
mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers,
sizeof(struct i3200_priv));
rc = -ENOMEM;
mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(struct i3200_priv));
if (!mci)
return -ENOMEM;
goto unmap;
edac_dbg(3, "MC: init mci\n");
@@ -421,9 +422,9 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
return 0;
fail:
edac_mc_free(mci);
unmap:
iounmap(window);
if (mci)
edac_mc_free(mci);
return rc;
}

View File

@@ -341,9 +341,12 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx)
layers[1].type = EDAC_MC_LAYER_CHANNEL;
layers[1].size = x38_channel_num;
layers[1].is_virt_csrow = false;
rc = -ENOMEM;
mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
if (!mci)
return -ENOMEM;
goto unmap;
edac_dbg(3, "MC: init mci\n");
@@ -403,9 +406,9 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx)
return 0;
fail:
edac_mc_free(mci);
unmap:
iounmap(window);
if (mci)
edac_mc_free(mci);
return rc;
}