Skip to content

Commit

Permalink
ide-pmac: macio resource freeing bugfix
Browse files Browse the repository at this point in the history
Release DMA resource before zeroing pmif.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Feb 1, 2008
1 parent ed1f788 commit ed908fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/ide/ppc/pmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,12 +1228,12 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
/* The inteface is released to the common IDE layer */
dev_set_drvdata(&mdev->ofdev.dev, NULL);
iounmap(base);
if (pmif->dma_regs)
if (pmif->dma_regs) {
iounmap(pmif->dma_regs);
macio_release_resource(mdev, 1);
}
memset(pmif, 0, sizeof(*pmif));
macio_release_resource(mdev, 0);
if (pmif->dma_regs)
macio_release_resource(mdev, 1);
}

return rc;
Expand Down

0 comments on commit ed908fa

Please sign in to comment.