From: Pawel Wieczorkiewicz Date: Mon, 6 Jan 2020 12:56:23 +0000 (+0000) Subject: livepatch: use proper rc variable in livepatch_do_action() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~939 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0dd92688080202adcc43dcb3486d4143110a66d5;p=xen.git livepatch: use proper rc variable in livepatch_do_action() Fix c&p bug in the livepatch_do_action() code of LIVEPATCH_ACTION_REPLACE case. The correct variable handling return code of revert action is other->rc in this case. Coverity-ID: 1457467 Fixes: 6047104c3c ("livepatch: Add per-function applied/reverted state tracking marker") Reported-by: Andrew Cooper Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Konrad Rzeszutek Wilk --- diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c index 2a8ab13879..5e09dc990b 100644 --- a/xen/common/livepatch.c +++ b/xen/common/livepatch.c @@ -1456,7 +1456,9 @@ static void livepatch_do_action(void) else other->rc = revert_payload(other); - if ( !was_action_consistent(other, rc ? LIVEPATCH_FUNC_APPLIED : LIVEPATCH_FUNC_NOT_APPLIED) ) + if ( !was_action_consistent(other, other->rc + ? LIVEPATCH_FUNC_APPLIED + : LIVEPATCH_FUNC_NOT_APPLIED) ) panic("livepatch: partially reverted payload '%s'!\n", other->name); if ( other->rc == 0 )