lkml.org 
[lkml]   [2022]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] secretmem: use ATOMIC_INIT() to initialize secretmem_users
Date
The variable secretmem_users is of atomic_t type, so initialize it
properly with ATOMIC_INIT().

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
mm/secretmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/secretmem.c b/mm/secretmem.c
index e3e9590c6fb3..796d3a92992a 100644
--- a/mm/secretmem.c
+++ b/mm/secretmem.c
@@ -40,7 +40,7 @@ module_param_named(enable, secretmem_enable, bool, 0400);
MODULE_PARM_DESC(secretmem_enable,
"Enable secretmem and memfd_secret(2) system call");

-static atomic_t secretmem_users;
+static atomic_t secretmem_users = ATOMIC_INIT(0);

bool secretmem_active(void)
{
--
2.17.1
\
 
 \ /
  Last update: 2022-09-06 11:40    [W:0.075 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site