From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Subject: [PATCH 01/18] pstore: Use dynamic spinlock initializer Date: Mon, 6 Mar 2017 13:55:15 -0800 Message-ID: <1488837332-71582-2-git-send-email-keescook@chromium.org> References: <1488837332-71582-1-git-send-email-keescook@chromium.org> Return-path: In-Reply-To: <1488837332-71582-1-git-send-email-keescook@chromium.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" To: linux-kernel@vger.kernel.org Cc: linux-efi@vger.kernel.org, linux-doc@vger.kernel.org, Matt Fleming , Pan Xinhui , Paul Gortmaker , Paul Mackerras , Anton Vorontsov , linux-acpi@vger.kernel.org, Nathan Fontenot , Len Brown , Kees Cook , Nobuhiro Iwamatsu , Geliang Tang , Tony Luck , Daniel Axtens , Qiuxu Zhuo , Ard Biesheuvel , "Rafael J. Wysocki" , stable@vger.kernel.org, Colin Cross , linuxppc-dev@lists.ozlabs.org List-Id: linux-acpi@vger.kernel.org The per-prz spinlock should be using the dynamic initializer so that lockdep can correctly track it. Without this, under lockdep, we get a warning at boot that the lock is in non-static memory. Fixes: 109704492ef6 ("pstore: Make spinlock per zone instead of global") Fixes: 76d5692a5803 ("pstore: Correctly initialize spinlock and flags") Signed-off-by: Kees Cook Cc: stable@vger.kernel.org --- fs/pstore/ram_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index bc927e30bdcc..e11672aa4575 100644 --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -532,7 +532,7 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size, } /* Initialize general buffer state. */ - prz->buffer_lock = __RAW_SPIN_LOCK_UNLOCKED(buffer_lock); + raw_spin_lock_init(&prz->buffer_lock); prz->flags = flags; ret = persistent_ram_buffer_map(start, size, prz, memtype); -- 2.7.4