lkml.org 
[lkml]   [2010]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] ioatdma: Release memory in error handling path
From
Date

Release memory in error handling path

Signed-off-by: Minskey Guo <chaohong_guo@linux.intel.com>

---
drivers/dma/ioat/pci.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/dma/ioat/pci.c b/drivers/dma/ioat/pci.c
index a6e93ee..2a3dae9 100644
--- a/drivers/dma/ioat/pci.c
+++ b/drivers/dma/ioat/pci.c
@@ -153,10 +153,12 @@ static int __devinit ioat_pci_probe(struct pci_dev
*pdev, const struct pci_devic
else if (device->version >= IOAT_VER_3_0)
err = ioat3_dma_probe(device, ioat_dca_enabled);
else
- return -ENODEV;
+ err = -ENODEV;

if (err) {
dev_err(dev, "Intel(R) I/OAT DMA Engine init failed\n");
+ pci_set_drvdata(pdev, NULL);
+ devm_kfree(dev, device)
return -ENODEV;
}
--
1.6.3.3



\
 
 \ /
  Last update: 2010-04-12 05:55    [from the cache]
©2003-2011 Jasper Spaans