]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Take into account that alloc_dev_data() may return NULL
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 22 Mar 2018 15:22:33 +0000 (16:22 +0100)
committerJoerg Roedel <jroedel@suse.de>
Thu, 29 Mar 2018 08:38:14 +0000 (10:38 +0200)
commit9f7a2f72f980e0a5a64000ff2d477a7452c550d3
treebc75f5ff338a71b941e204c1611dc7d7cb44f891
parentc86d824047a0d9904d3b53c6d6cb9223db204db0
iommu/amd: Take into account that alloc_dev_data() may return NULL

find_dev_data() does not check whether the return value alloc_dev_data()
is NULL. This was okay once because the pointer was returned once as-is.
Since commit 35616215938b ("iommu/amd: Use is_attach_deferred
call-back") the pointer may be used within find_dev_data() so a NULL
check is required.

Cc: Baoquan He <bhe@redhat.com>
Fixes: 35616215938b ("iommu/amd: Use is_attach_deferred call-back")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c