From: Jan Beulich Date: Tue, 7 Sep 2021 07:37:50 +0000 (+0200) Subject: gnttab: adjust unmap checking of dev_bus_addr X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~225 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c5bf1295b0da079249df5c6e2d7498a8ec336527;p=xen.git gnttab: adjust unmap checking of dev_bus_addr There's no point checking ->dev_bus_addr when GNTMAP_device_map isn't set (and hence the field isn't going to be consumed). And if there is a mismatch, use the so far unused GNTST_bad_dev_addr error indicator - if not here, where else would this (so far unused) value be used? Signed-off-by: Jan Beulich Acked-by: Julien Grall --- diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index da687acc61..df74e2d6a7 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -1450,9 +1450,9 @@ unmap_common( op->mfn = act->mfn; - if ( op->dev_bus_addr && + if ( op->dev_bus_addr && (flags & GNTMAP_device_map) && unlikely(op->dev_bus_addr != mfn_to_maddr(act->mfn)) ) - PIN_FAIL(act_release_out, GNTST_general_error, + PIN_FAIL(act_release_out, GNTST_bad_dev_addr, "Bus address doesn't match gntref (%"PRIx64" != %"PRIpaddr")\n", op->dev_bus_addr, mfn_to_maddr(act->mfn));