]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
x86/pmem: Fix platform-device leak in error path
authorJohan Hovold <johan@kernel.org>
Mon, 20 Jun 2022 14:07:23 +0000 (16:07 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:55:59 +0000 (11:55 +0200)
commit61412baf190eed486313046ffe6cd23cd35eff4f
treefbdb1c02bcbca1371c68b0f5230ecc659f84e635
parent8212cf7467d8f417a9a5d7576511a3381b949817
x86/pmem: Fix platform-device leak in error path

BugLink: https://bugs.launchpad.net/bugs/1990162
[ Upstream commit 229e73d46994f15314f58b2d39bf952111d89193 ]

Make sure to free the platform device in the unlikely event that
registration fails.

Fixes: 7a67832c7e44 ("libnvdimm, e820: make CONFIG_X86_PMEM_LEGACY a tristate option")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220620140723.9810-1-johan@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kernel/pmem.c