summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/amd_iommu_types.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-08-27 17:10:34 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-08-27 17:10:34 -0700
commit2c25833c426b85ed40fc0120b5020a6fb836538f (patch)
tree044ea78b73a4b695bda58e5d421ee0c26e252a49 /drivers/iommu/amd_iommu_types.h
parent80f73b2da09af8ba94c07c8f34774f4f79330321 (diff)
parent2926a2aa5c14fb2add75e6584845b1c03022235f (diff)
downloadop-kernel-dev-2c25833c426b85ed40fc0120b5020a6fb836538f.zip
op-kernel-dev-2c25833c426b85ed40fc0120b5020a6fb836538f.tar.gz
Merge tag 'iommu-fixes-v4.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU fix from Joerg Roedel: "Another fix, this time in common IOMMU sysfs code. In the conversion from the old iommu sysfs-code to the iommu_device_register interface, I missed to update the release path for the struct device associated with an IOMMU. It freed the 'struct device', which was a pointer before, but is now embedded in another struct. Freeing from the middle of allocated memory had all kinds of nasty side effects when an IOMMU was unplugged. Unfortunatly nobody unplugged and IOMMU until now, so this was not discovered earlier. The fix is to make the 'struct device' a pointer again" * tag 'iommu-fixes-v4.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu: Fix wrong freeing of iommu_device->dev
Diffstat (limited to 'drivers/iommu/amd_iommu_types.h')
-rw-r--r--drivers/iommu/amd_iommu_types.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index 294a409..d6b873b 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -574,7 +574,9 @@ struct amd_iommu {
static inline struct amd_iommu *dev_to_amd_iommu(struct device *dev)
{
- return container_of(dev, struct amd_iommu, iommu.dev);
+ struct iommu_device *iommu = dev_to_iommu_device(dev);
+
+ return container_of(iommu, struct amd_iommu, iommu);
}
#define ACPIHID_UID_LEN 256
OpenPOWER on IntegriCloud