summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/etnaviv/etnaviv_drv.h
diff options
context:
space:
mode:
authorAnna-Maria Gleixner2018-05-07 14:53:27 +0200
committerJoerg Roedel2018-05-15 16:39:18 +0200
commitea3fd04028cb9e317133e0f8794d15ad508489a8 (patch)
tree42fa583a10309b988e22bc537850b34f1e451308 /drivers/gpu/drm/etnaviv/etnaviv_drv.h
parentiommu/amd: Fix grammar of comments (diff)
downloadkernel-qcow2-linux-ea3fd04028cb9e317133e0f8794d15ad508489a8.tar.gz
kernel-qcow2-linux-ea3fd04028cb9e317133e0f8794d15ad508489a8.tar.xz
kernel-qcow2-linux-ea3fd04028cb9e317133e0f8794d15ad508489a8.zip
iommu/amd: Prevent possible null pointer dereference and infinite loop
The check for !dev_data->domain in __detach_device() emits a warning and returns. The calling code in detach_device() dereferences dev_data->domain afterwards unconditionally, so in case that dev_data->domain is NULL the warning will be immediately followed by a NULL pointer dereference. The calling code in cleanup_domain() loops infinite when !dev_data->domain and the check in __detach_device() returns immediately because dev_list is not changed. do_detach() duplicates this check without throwing a warning. Move the check with the explanation of the do_detach() code into the caller detach_device() and return immediately. Throw an error, when hitting the condition in cleanup_domain(). Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_drv.h')
0 files changed, 0 insertions, 0 deletions