[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/iommu: dt: Check the return value of xsm_deassign_dtdevice()



commit b22db3fcba1a5b4f9e563b58d402f1d5c434209f
Author:     Julien Grall <jgrall@xxxxxxxxxx>
AuthorDate: Wed May 25 09:52:38 2022 +0100
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Wed May 25 09:52:59 2022 +0100

    xen/iommu: dt: Check the return value of xsm_deassign_dtdevice()
    
    xsm_deassign_dtdevice() will indicate whether the caller is allowed
    to issue the operation. So the return value has to be checked.
    
    Spotted by clang static analyzer.
    
    Fixes: fe36cccc483c ("xen/passthrough: Extend XEN_DOMCTL_*assign_device to 
support DT device")
    Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
    Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
---
 xen/drivers/passthrough/device_tree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/passthrough/device_tree.c 
b/xen/drivers/passthrough/device_tree.c
index 98f2aa0dad..1c32d7b50c 100644
--- a/xen/drivers/passthrough/device_tree.c
+++ b/xen/drivers/passthrough/device_tree.c
@@ -269,6 +269,8 @@ int iommu_do_dt_domctl(struct xen_domctl *domctl, struct 
domain *d,
             break;
 
         ret = xsm_deassign_dtdevice(XSM_HOOK, d, dt_node_full_name(dev));
+        if ( ret )
+            break;
 
         if ( d == dom_io )
             return -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.