diff options
author | Eric Auger <eric.auger@linaro.org> | 2015-11-03 13:12:19 -0500 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2015-11-03 14:55:06 -0500 |
commit | daac3bbedb8aba714a082d00e2292d462fa24397 (patch) | |
tree | 575d31068914ecc0a7665576ca0949a0ce68b6ce /drivers/vfio | |
parent | 705e60bae3e09bedba0b2ec936bce3f799f46426 (diff) |
vfio: platform: reset: calxedaxgmac: fix ioaddr leak
In the current code the vfio_platform_region is copied on the stack.
As a consequence the ioaddr address is not iounmapped in the vfio
platform driver (vfio_platform_regions_cleanup). The patch uses the
pointer to the region instead.
Signed-off-by: Eric Auger <eric.auger@linaro.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r-- | drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c b/drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c index 640f5d87d422..e3d3d948e661 100644 --- a/drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c +++ b/drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c | |||
@@ -59,20 +59,20 @@ static inline void xgmac_mac_disable(void __iomem *ioaddr) | |||
59 | 59 | ||
60 | int vfio_platform_calxedaxgmac_reset(struct vfio_platform_device *vdev) | 60 | int vfio_platform_calxedaxgmac_reset(struct vfio_platform_device *vdev) |
61 | { | 61 | { |
62 | struct vfio_platform_region reg = vdev->regions[0]; | 62 | struct vfio_platform_region *reg = &vdev->regions[0]; |
63 | 63 | ||
64 | if (!reg.ioaddr) { | 64 | if (!reg->ioaddr) { |
65 | reg.ioaddr = | 65 | reg->ioaddr = |
66 | ioremap_nocache(reg.addr, reg.size); | 66 | ioremap_nocache(reg->addr, reg->size); |
67 | if (!reg.ioaddr) | 67 | if (!reg->ioaddr) |
68 | return -ENOMEM; | 68 | return -ENOMEM; |
69 | } | 69 | } |
70 | 70 | ||
71 | /* disable IRQ */ | 71 | /* disable IRQ */ |
72 | writel(0, reg.ioaddr + XGMAC_DMA_INTR_ENA); | 72 | writel(0, reg->ioaddr + XGMAC_DMA_INTR_ENA); |
73 | 73 | ||
74 | /* Disable the MAC core */ | 74 | /* Disable the MAC core */ |
75 | xgmac_mac_disable(reg.ioaddr); | 75 | xgmac_mac_disable(reg->ioaddr); |
76 | 76 | ||
77 | return 0; | 77 | return 0; |
78 | } | 78 | } |