Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp183053pxf; Tue, 6 Apr 2021 18:53:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP+cb/1EAd4HWYxEPp5AkoFJIUroInRAFTL+WpntU3b0Ldz9IszyudgTE3/b3eiAG/JPDB X-Received: by 2002:a05:6e02:781:: with SMTP id q1mr887276ils.59.1617760394844; Tue, 06 Apr 2021 18:53:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617760394; cv=none; d=google.com; s=arc-20160816; b=KqNJBxbI5ov+6UJyLAHYYP9znLBNG11nHhDz/eBvM5HaZAxmYDSnypyM3P9u8wym2m 1WbnBA32qNRcmm9P4xg8MxcQ9UH1gBog4Lzak0LqYOliCgsaVh6+Lpo/CEDzve5Lzrxb ERaKGQ1oeu1FSeItWWQSwoXCOmiSZAVrPtAuvZc6kt/JBlit3CW62V+2smk7TqPk/iSi qb+oA1CitleEWO66afYbNAF0NRzCWQCl095dGevmZ780lETGv4HYNMHWTWvC3U4nSrKo lGrEL1/qH4Kr5kdj+DzIanfCssAZuof1m2Jfg4t+wpZgkLX5lp6C36ulOvtgtL/Gl91v AdTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=o0gbcho1tv+F+Fp3SZHoh2dZ/mhUkBOGqynISyY1oR4=; b=Jxo05Di9H8rgpcpLUOhLFoRhdfPvIUezm0fYhjflg0HmCf2VSSO4uIx5pgyWQpn59e Vd7gfpESD2sTgGUWvc8eJUxMnEwC8x51RJtO+BK77hCV2Dzo6TzpEx/qA8PYADp2wxBl +8kgs78kFykZ6LVTFMCWpaZCRRBWXOsvU8TFe6ZeCQ0pfFcoCxRBEmkTKDbuBJ+/iusm lJZOaEFsRlo+ZTav6j55v8Maj6OkXDZywE1v0EL77p1T4vexu21D/jFUewfCM4P4pktO S1vDDRc5doy4MBE9ctcO9MUCCcp3NSB5GQNQJSroWoUyWrTEuhUWG776MWJVGEePWzS4 gGaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si19794382ilu.81.2021.04.06.18.52.59; Tue, 06 Apr 2021 18:53:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343904AbhDFMVG (ORCPT + 99 others); Tue, 6 Apr 2021 08:21:06 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:15918 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239518AbhDFMVF (ORCPT ); Tue, 6 Apr 2021 08:21:05 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FF65S1DsFzkhLv; Tue, 6 Apr 2021 20:19:08 +0800 (CST) Received: from huawei.com (10.175.112.208) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 20:20:43 +0800 From: Wang Wensheng To: , , , , , , , , , CC: Subject: [PATCH -next] KVM: arm64: Fix error return code in init_hyp_mode() Date: Tue, 6 Apr 2021 12:17:59 +0000 Message-ID: <20210406121759.5407-1-wangwensheng4@huawei.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.208] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: eeeee7193df0 ("KVM: arm64: Bootstrap PSCI SMC handler in nVHE EL2") Reported-by: Hulk Robot Signed-off-by: Wang Wensheng --- arch/arm64/kvm/arm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 76a7de1..41e0b2a 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -1877,8 +1877,10 @@ static int init_hyp_mode(void) if (is_protected_kvm_enabled()) { init_cpu_logical_map(); - if (!init_psci_relay()) + if (!init_psci_relay()) { + err = -ENODEV; goto out_err; + } } if (is_protected_kvm_enabled()) { -- 2.9.4