]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
misc: open-dice: Fix spurious lockdep warning
authorWill Deacon <will@kernel.org>
Fri, 26 Jan 2024 15:24:10 +0000 (15:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:34:51 +0000 (13:34 +0100)
commit9e8e25f201915bee294e373f752e43895b193165
tree0e7158d0be8da4d710804f483657bc64911b0862
parent17a6d7a0a7a9d846f321eaab7e2021fb4b2eb631
misc: open-dice: Fix spurious lockdep warning

[ Upstream commit ac9762a74c7ca7cbfcb4c65f5871373653a046ac ]

When probing the open-dice driver with PROVE_LOCKING=y, lockdep
complains that the mutex in 'drvdata->lock' has a non-static key:

 | INFO: trying to register non-static key.
 | The code is fine but needs lockdep annotation, or maybe
 | you didn't initialize this object before use?
 | turning off the locking correctness validator.

Fix the problem by initialising the mutex memory with mutex_init()
instead of __MUTEX_INITIALIZER().

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Brazdil <dbrazdil@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20240126152410.10148-1-will@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/open-dice.c