Merge tag 'iommu-fixes-v5.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU fix from Joerg Roedel: "Fix a possible NULL-ptr dereference in dev_iommu_priv_get() which is too easy to accidentially trigger from IOMMU drivers. In the current case the AMD IOMMU driver triggered it on some machines in the IO-page-fault path, so fix it once and for all" * tag 'iommu-fixes-v5.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu: Check dev->iommu in dev_iommu_priv_get() before dereferencing it
This commit is contained in:
@@ -616,7 +616,10 @@ static inline void dev_iommu_fwspec_set(struct device *dev,
|
||||
|
||||
static inline void *dev_iommu_priv_get(struct device *dev)
|
||||
{
|
||||
return dev->iommu->priv;
|
||||
if (dev->iommu)
|
||||
return dev->iommu->priv;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void dev_iommu_priv_set(struct device *dev, void *priv)
|
||||
|
||||
Reference in New Issue
Block a user