From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0787181BB8; Wed, 26 Jun 2024 13:37:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719409026; cv=none; b=II371zNbzx9Ow6QzqHSLhD/0gUzfBD2SKbgjAGY8jsdhL9v0DTfJdVq6rwSgAuw5b404ecSkJi/qNeINXaW10er2GffJKDg8EejX33/uNUxComBhFiKPWUrdM+c7VUy9v00Gd1uZAow1rrigzHpM2YYf+W9swYZ8o4D/SMf5YEM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719409026; c=relaxed/simple; bh=X12RbHoxP9jbZfCWKOU7ejTpCDFLpnqDMFHO42Ory5M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=H2nOKs/eKDN2eUqeEYLPxQv+E05WIiyJb3Ddjb7dInAvE9F3vu6LU80ISo3Yb/sGjD6aMGgOjZg7F+SoYZ40DIQ3sre8yhmYbHMbdGrUFCDQlp8UCtaiRESHAN+dewxH5vvHbclR9hxIqjPePgNw6X6oawVAOKHJqHqtODZ8dlY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D87CF367; Wed, 26 Jun 2024 06:37:28 -0700 (PDT) Received: from [10.162.42.14] (e116581.arm.com [10.162.42.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ADDEE3F73B; Wed, 26 Jun 2024 06:36:59 -0700 (PDT) Message-ID: Date: Wed, 26 Jun 2024 19:06:50 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/2] selftests: Add a test mangling with uc_sigmask To: Oleg Nesterov Cc: shuah@kernel.org, mingo@kernel.org, tglx@linutronix.de, mark.rutland@arm.com, ryan.roberts@arm.com, broonie@kernel.org, suzuki.poulose@arm.com, Anshuman.Khandual@arm.com, DeepakKumar.Mishra@arm.com, aneesh.kumar@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240626054847.1463889-1-dev.jain@arm.com> <20240626054847.1463889-3-dev.jain@arm.com> <20240626115410.GA27271@redhat.com> Content-Language: en-US From: Dev Jain In-Reply-To: <20240626115410.GA27271@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/26/24 17:24, Oleg Nesterov wrote: > On 06/26, Dev Jain wrote: >> +int main(int argc, char *argv[]) >> +{ >> + struct sigaction act, act2; >> + sigset_t *set, *oldset; > ... > >> + set = malloc(sizeof(sigset_t *)); >> + if (!set) >> + ksft_exit_fail_perror("malloc"); >> + >> + oldset = malloc(sizeof(sigset_t *)); > Why malloc() ? > > Can't you simply do > > sigset_t set, oldset; > > and then use sigemptyset(&set) / etc ? > > Oleg. Ah yes, let us allocate it on the stack. I shall change it. >