From patchwork Mon Jan 6 12:56:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wieczorkiewicz, Pawel" X-Patchwork-Id: 11319211 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6A0A1871 for ; Mon, 6 Jan 2020 12:57:24 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1CD820731 for ; Mon, 6 Jan 2020 12:57:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.de header.i=@amazon.de header.b="qZBFLl+3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1CD820731 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ioRvt-0002c4-SQ; Mon, 06 Jan 2020 12:56:33 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ioRvt-0002bt-8v for xen-devel@lists.xenproject.org; Mon, 06 Jan 2020 12:56:33 +0000 X-Inumbo-ID: f6e33db6-3083-11ea-ab01-12813bfff9fa Received: from smtp-fw-2101.amazon.com (unknown [72.21.196.25]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f6e33db6-3083-11ea-ab01-12813bfff9fa; Mon, 06 Jan 2020 12:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1578315393; x=1609851393; h=from:to:cc:subject:date:message-id:mime-version; bh=mjmOd3Fhhp/+5+LbgHhZWvhd9TtBU0ojPc/uIol9plI=; b=qZBFLl+3bLwtyKWB4VvW+akEgUNe4vdRVcX51OUQ2Y6OrEfKBMxV/JK9 bgIlhifDSFVe04q2kXwo+H+MHy/irP1I1Z1oIPOA1eX96VtFN06JAAaf5 v2HeA0htb2LduD86tRMTjIF+oXY2qNQHWU22Blt9rn2aeYJZfuyU0uaFk s=; IronPort-SDR: YWBOBcDpG8djRJs9dyqaYs2Ibo6GPVMe/w2dw5/UiRjGPnUJq033h7EtaVXUMicTl3IIT2Ne3W 6US9/ibP/nqQ== X-IronPort-AV: E=Sophos;i="5.69,402,1571702400"; d="scan'208";a="11161563" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1d-74cf8b49.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 06 Jan 2020 12:56:32 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1d-74cf8b49.us-east-1.amazon.com (Postfix) with ESMTPS id EA04BC06ED; Mon, 6 Jan 2020 12:56:31 +0000 (UTC) Received: from EX13D05EUB003.ant.amazon.com (10.43.166.253) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Mon, 6 Jan 2020 12:56:31 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D05EUB003.ant.amazon.com (10.43.166.253) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 6 Jan 2020 12:56:30 +0000 Received: from dev-dsk-wipawel-1a-0c4e6d58.eu-west-1.amazon.com (10.4.134.33) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 6 Jan 2020 12:56:28 +0000 From: Pawel Wieczorkiewicz To: Date: Mon, 6 Jan 2020 12:56:23 +0000 Message-ID: <20200106125623.97666-1-wipawel@amazon.de> X-Mailer: git-send-email 2.16.5 MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH] livepatch: use proper rc variable in livepatch_do_action() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Pawel Wieczorkiewicz , Ross Lagerwall , Andrew Cooper , Konrad Rzeszutek Wilk Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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") Signed-off-by: Pawel Wieczorkiewicz Reported-by: Andrew Cooper Reviewed-by: Konrad Rzeszutek Wilk --- xen/common/livepatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c index 2a8ab13879..5c67f3de5a 100644 --- a/xen/common/livepatch.c +++ b/xen/common/livepatch.c @@ -1456,7 +1456,7 @@ 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 )