]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86/amd/pmf: Ensure mutexes are initialized before use
authorHans de Goede <hdegoede@redhat.com>
Mon, 30 Jan 2023 13:25:54 +0000 (14:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:07 +0000 (11:28 +0100)
commita72955d4aed7d148ba3907dc7408e0f864be6b84
tree7e6775114e11c0609958a490600f5b2d2df9c997
parent0a24131e14bb1a9fe6b1eb5ca912803816042ccc
platform/x86/amd/pmf: Ensure mutexes are initialized before use

[ Upstream commit e0c40529ff942a985eb0f3dacf18d35ee4dbb03d ]

As soon as the first handler or sysfs file is registered
the mutex may get used.

Move the initialization to before any handler registration /
sysfs file creation.

Likewise move the destruction of the mutex to after all
the de-initialization is done.

Fixes: f3e11f9f79fe ("platform/x86/amd/pmf: Add support for PMF core layer")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230130132554.696025-1-hdegoede@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/amd/pmf/core.c