]> git.baikalelectronics.ru Git - kernel.git/commit
efi: fix NULL-deref in init error path
authorJohan Hovold <johan+linaro@kernel.org>
Mon, 19 Dec 2022 09:10:04 +0000 (10:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:32 +0000 (11:58 +0100)
commit08f9f5f8e857b53d2351e8e37a782154928a2b1d
tree0074bae1abb9ed693ed8413e6a072a1bde5b2883
parent25d4ab6a5788ea67a189bb13b4ed130575907c91
efi: fix NULL-deref in init error path

[ Upstream commit 8da8940a85525728fdf37846a2fb30d7c8faad10 ]

In cases where runtime services are not supported or have been disabled,
the runtime services workqueue will never have been allocated.

Do not try to destroy the workqueue unconditionally in the unlikely
event that EFI initialisation fails to avoid dereferencing a NULL
pointer.

Fixes: 7b4854daf5cc ("efi: add missed destroy_workqueue when efisubsys_init fails")
Cc: stable@vger.kernel.org
Cc: Li Heng <liheng40@huawei.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/efi/efi.c