From patchwork Fri Sep 29 11:20:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 728304 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 0C73AE7F154 for ; Fri, 29 Sep 2023 11:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232920AbjI2LVI (ORCPT ); Fri, 29 Sep 2023 07:21:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232925AbjI2LVH (ORCPT ); Fri, 29 Sep 2023 07:21:07 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE1341AE; Fri, 29 Sep 2023 04:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695986465; x=1727522465; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PVn56X56Wrx64QPNUKF/C+r8extw29MLooKw3ZIFeg0=; b=Od+yffdlyqFRakdps9yErecSDjHt6AufjgACn1gJUUEwphKgKygZkO0N RMcEhMhd8+a9siMbAwFqdIkJO4f5zRWYfLsyoR2Q2Q8EXbI7df5kLJCDp U3Jfyutf70QxN8MaCBCpUKyiZws+kCZ1ZwhQygZ3q0I6acFUiTXZUTzSp s9HepuSBR/bqvhIXrV8cgj1Sb4ifR40VehebM1+VjQHifffJSZTFa3VLR FWMwYzM99WIsUYkfMN1L+FBt1hjoEh46jcEcXL6Flt1xv7X5ndWXYIboq Qvz+/82DzUeduYauZJtDruLbekVkqBMQ0ofy30u1RO77x9I6PvzF8HyWP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="446435510" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="446435510" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 04:21:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="779243762" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="779243762" Received: from valeks2x-mobl.ger.corp.intel.com (HELO localhost) ([10.252.53.242]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 04:20:59 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Shuah Khan , Reinette Chatre , =?utf-8?q?Maciej_Wiecz=C3=B3r-?= =?utf-8?q?Retman?= , Shaopeng Tan Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= Subject: [PATCH v3 1/7] selftests/resctrl: Fix uninitialized .sa_flags Date: Fri, 29 Sep 2023 14:20:33 +0300 Message-Id: <20230929112039.7488-2-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230929112039.7488-1-ilpo.jarvinen@linux.intel.com> References: <20230929112039.7488-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org signal_handler_unregister() calls sigaction() with uninitializing sa_flags in the struct sigaction. Make sure sa_flags is always initialized in signal_handler_unregister() by initializing the struct sigaction when declaring it. Fixes: 73c55fa5ab55 (selftests/resctrl: Commonize the signal handler register/unregister for all tests) Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Cc: --- tools/testing/selftests/resctrl/resctrl_val.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index 51963a6f2186..1e8b90077218 100644 --- a/tools/testing/selftests/resctrl/resctrl_val.c +++ b/tools/testing/selftests/resctrl/resctrl_val.c @@ -504,7 +504,7 @@ int signal_handler_register(void) */ void signal_handler_unregister(void) { - struct sigaction sigact; + struct sigaction sigact = {}; sigact.sa_handler = SIG_DFL; sigemptyset(&sigact.sa_mask);