From nobody Sat Oct 18 02:17:39 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65793C3A59D for ; Wed, 19 Oct 2022 11:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232405AbiJSL40 (ORCPT ); Wed, 19 Oct 2022 07:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232663AbiJSLyy (ORCPT ); Wed, 19 Oct 2022 07:54:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E7851B864F; Wed, 19 Oct 2022 04:34:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 906D8B8244F; Wed, 19 Oct 2022 08:59:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07288C433D6; Wed, 19 Oct 2022 08:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169993; bh=coQ3Q/Ae05f07tSDbuwVfPnSEuQZI1GqMFwqyzL101s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BdJW+BnBV/j+1hQVaJcsIwW8zeywOHUTcglyGgWrs7/81ga126WBy+OibzF1E9n83 8vMk+bKCRVZ2PWlgfdv9aIUj8se7AaaX+cBuCq5GuGwcuyc5oef20hiupK96rJxkvt Qy/SY8KDHvVp20UFNLtyabmQxIOWC77SqbyMk0l8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhao Gongyi , Shuah Khan , Sasha Levin Subject: [PATCH 6.0 454/862] selftests/cpu-hotplug: Use return instead of exit Date: Wed, 19 Oct 2022 10:29:01 +0200 Message-Id: <20221019083310.034366440@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Zhao Gongyi [ Upstream commit 972cf4ce51ef5532d56822af17defb148aac0ccb ] Some cpus will be left in offline state when online function exits in some error conditions. Use return instead of exit to fix it. Signed-off-by: Zhao Gongyi Signed-off-by: Shuah Khan Stable-dep-of: 51d4c851465c ("selftests/cpu-hotplug: Reserve one cpu online= at least") Signed-off-by: Sasha Levin --- .../selftests/cpu-hotplug/cpu-on-off-test.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools= /testing/selftests/cpu-hotplug/cpu-on-off-test.sh index 0d26b5e3f966..940b68c940bb 100755 --- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh +++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh @@ -4,6 +4,7 @@ SYSFS=3D # Kselftest framework requirement - SKIP code is 4. ksft_skip=3D4 +retval=3D0 =20 prerequisite() { @@ -102,10 +103,10 @@ online_cpu_expect_success() =20 if ! online_cpu $cpu; then echo $FUNCNAME $cpu: unexpected fail >&2 - exit 1 + retval=3D1 elif ! cpu_is_online $cpu; then echo $FUNCNAME $cpu: unexpected offline >&2 - exit 1 + retval=3D1 fi } =20 @@ -128,10 +129,10 @@ offline_cpu_expect_success() =20 if ! offline_cpu $cpu; then echo $FUNCNAME $cpu: unexpected fail >&2 - exit 1 + retval=3D1 elif ! cpu_is_offline $cpu; then echo $FUNCNAME $cpu: unexpected offline >&2 - exit 1 + retval=3D1 fi } =20 @@ -201,7 +202,7 @@ if [ $allcpus -eq 0 ]; then offline_cpu_expect_success $present_max online_cpu $present_max fi - exit 0 + exit $retval else echo "Full scope test: all hotplug cpus" echo -e "\t online all offline cpus" @@ -291,3 +292,5 @@ done =20 echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/CPU_DOWN_PREPARE/error /sbin/modprobe -q -r cpu-notifier-error-inject + +exit $retval --=20 2.35.1