iommu/amd: Fix NULL dereference bug in match_hid_uid
authorAaron Ma <aaron.ma@canonical.com>
Wed, 13 Mar 2019 13:53:24 +0000 (21:53 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 15 Mar 2019 15:22:05 +0000 (16:22 +0100)
commitbb6bccba390c7d743c1e4427de4ef284c8cc6869
tree6ecc7bc4382425f2d9a4b0188848b9454261cbf9
parentd05e4c8600c36084ce9de6249bb972c9bdd75b7e
iommu/amd: Fix NULL dereference bug in match_hid_uid

Add a non-NULL check to fix potential NULL pointer dereference
Cleanup code to call function once.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Fixes: 2bf9a0a12749b ('iommu/amd: Add iommu support for ACPI HID devices')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c