提交 bc2618f7 编写于 作者: F Florin Malita 提交者: Jeff Garzik

tehuti: possible leak in bdx_probe

If pci_enable_device fails, bdx_probe returns without freeing the
allocated pci_nic structure.

Coverity CID 1908.
Signed-off-by: NFlorin Malita <fmalita@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 7e7b968a
......@@ -1906,7 +1906,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/************** pci *****************/
if ((err = pci_enable_device(pdev))) /* it trigers interrupt, dunno why. */
RET(err); /* it's not a problem though */
goto err_pci; /* it's not a problem though */
if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)) &&
!(err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK))) {
......@@ -2076,6 +2076,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_release_regions(pdev);
err_dma:
pci_disable_device(pdev);
err_pci:
vfree(nic);
RET(err);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册