Skip to content
Commit 78becab9 authored by Alexey Kardashevskiy's avatar Alexey Kardashevskiy Committed by Alex Williamson
Browse files

vfio/spapr_tce: Fix incorrect tce_iommu_group memory free

The @tcegrp variable is used in 1) a loop over attached groups
2) it stores a pointer to a newly allocated tce_iommu_group if 1) found
nothing. However the error handler does not distinguish how we got there
and incorrectly releases memory for a found+incompatible group.

This fixes it by adding another error handling case.

Fixes: 0bd97167

 ("powerpc/powernv/npu: Add compound IOMMU groups")
Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: default avatarPaul Mackerras <paulus@ozlabs.org>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent d1abaeb3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment