iommu/core: Make iommu_group_get_for_dev() more robust
When a non-PCI device is passed to that function it might pass group == NULL to iommu_group_add_device() which then dereferences it and cause a crash this way. Fix it by just returning an error for non-PCI devices. Fixes: 104a1c13 Cc: Alex Williamson <alex.williamson@redhat.com> Acked-by: NAlex Williamson <alex.williamson@redhat.com> Signed-off-by: NJoerg Roedel <jroedel@suse.de>
Showing
想要评论请 注册 或 登录