Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258418
b: refs/heads/master
c: 04e506b
h: refs/heads/master
v: v3
  • Loading branch information
Vasiliy Kulikov authored and Jeff Garzik committed Jul 23, 2011
1 parent ec3270d commit 5beb88b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c4aa91f21f65b7b40bdfb015eacbcb8453ccae2
refs/heads/master: 04e506b5e7bd61c3a99af9964f7f1177c17f3424
21 changes: 14 additions & 7 deletions trunk/drivers/ata/sata_dwc_460ex.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,11 +766,15 @@ static int dma_dwc_xfer_setup(struct scatterlist *sg, int num_elems,
static void dma_dwc_exit(struct sata_dwc_device *hsdev)
{
dev_dbg(host_pvt.dwc_dev, "%s:\n", __func__);
if (host_pvt.sata_dma_regs)
if (host_pvt.sata_dma_regs) {
iounmap(host_pvt.sata_dma_regs);
host_pvt.sata_dma_regs = NULL;
}

if (hsdev->irq_dma)
if (hsdev->irq_dma) {
free_irq(hsdev->irq_dma, hsdev);
hsdev->irq_dma = 0;
}
}

/*
Expand Down Expand Up @@ -1642,7 +1646,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
if (hsdev == NULL) {
dev_err(&ofdev->dev, "kmalloc failed for hsdev\n");
err = -ENOMEM;
goto error_out;
goto error;
}
memset(hsdev, 0, sizeof(*hsdev));

Expand All @@ -1652,7 +1656,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
dev_err(&ofdev->dev, "ioremap failed for SATA register"
" address\n");
err = -ENODEV;
goto error_out;
goto error_kmalloc;
}
hsdev->reg_base = base;
dev_dbg(&ofdev->dev, "ioremap done for SATA register address\n");
Expand All @@ -1665,7 +1669,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
if (!host) {
dev_err(&ofdev->dev, "ata_host_alloc_pinfo failed\n");
err = -ENOMEM;
goto error_out;
goto error_iomap;
}

host->private_data = hsdev;
Expand Down Expand Up @@ -1733,8 +1737,11 @@ static int sata_dwc_probe(struct platform_device *ofdev)
/* Free SATA DMA resources */
dma_dwc_exit(hsdev);

if (base)
iounmap(base);
error_iomap:
iounmap(base);
error_kmalloc:
kfree(hsdev);
error:
return err;
}

Expand Down

0 comments on commit 5beb88b

Please sign in to comment.