mirror of https://github.com/torvalds/linux.git
- 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 -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmlsv50ACgkQEsHwGGHe VUpDoQ//bQlRmb9O09RqtD13R1ivlgYhucv9qUb8beLAY7xDpXVL/9S8dE/bHnRF IXl9KvCKFzFMxEAlKAqOI/Xv21l51KdqgFz6JJo4QIXzPUbMBZwdXSnZd3HGf4i8 f3tKTgJZQMY0egHuThiFxOrPdfGzxHRQ6Vv2K00b6jzn04Vzb0oGmZf1Mnvw7iXx zUusPIX72x5RzcA9enLj4hJvUdJTlCir9YHYulPW+8Uik6OTLNhMg+rzMPD0uhca JWz7XWRH7V+GA8wFTMaEe4UkGlfdsCSc2/ngsdrI+N1Om6H6r1MK+MlOowVal3LQ LSMacK+POMI5b/5qLti+10vQeYb/6Xf3C4hG5sEpAEqBpbiCIB16L9otvzMKzqEE LkMRN5qXaxGc9cd8h1JUKpdZoj2+aFKvsX0bMYzTgf3DgNIYoTTWswY4OXWYkjfN sHtaYiFPl0lf2Ran1ztM290vWiIeFEkYgatmWUd7rPHU/WbaLwL6KL0L2nQIGbas 9KEnZSz+LxTqZ8WWje+EiyG/EQW+7tpN5coFQ1Xu8kk087J217jCEnZ+VDjGNkEU VMoNupXM3XJ7fWarEnL8LXGNX1sV1s2jdTWOToD/ipO5UkLi/Bh/v0UEVvrsx4Id eFiddMoB+9jVbpfiqXy7hZKZXBzbdqOOzddGze1VDii+ROG2Wqc= =d17O -----END PGP SIGNATURE----- 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:
commit
93fc4e044a
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue