]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen/arm: dm: Bail out if padding != 0 for XEN_DMOP_set_irq_level
authorMichal Orzel <michal.orzel@amd.com>
Mon, 3 Mar 2025 08:56:47 +0000 (09:56 +0100)
committerMichal Orzel <michal.orzel@amd.com>
Tue, 4 Mar 2025 07:54:53 +0000 (08:54 +0100)
XEN_DMOP_set_irq_level operation requires elements of pad array (being
member of xen_dm_op_set_irq_level structure) to be 0. While handling the
hypercall we validate this. If one of the elements is not zero, we set
rc to -EINVAL. At this point we should stop further DM handling and bail
out propagating the error to the caller. However, instead of goto the
code uses break which has basically no meaningful effect. The rc value
is never read and the code continues with the hypercall processing ending
up (possibly) with the interrupt injection. Fix it.

Fixes: 5d752df85f2c ("xen/dm: Introduce xendevicemodel_set_irq_level DM op")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
xen/arch/arm/dm.c

index 773a0a2592726dcc6920992785cbd89095b87ff8..fdb3d967ec98e6abca494576a7252634fdf3500d 100644 (file)
@@ -93,7 +93,7 @@ int dm_op(const struct dmop_args *op_args)
             if ( data->pad[i] )
             {
                 rc = -EINVAL;
-                break;
+                goto out;
             }
         }