]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commita5761383b4cb33044905bdd5868f8050946595fe
tree291c853be0446db6caff07aa05812adab3f4731f
parentd2c8b1729023dfe2d39d9d591d6aeba00e15d660
iommu/amd: Take into account that alloc_dev_data() may return NULL

BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit 39ffe39545cd5cb5b8cee9f0469165cf24dc62c2 ]

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 df3f7a6e8e85 ("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: df3f7a6e8e85 ("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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/iommu/amd_iommu.c