]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Aug 2022 13:15:33 +0000 (15:15 +0200)
commit2c07688d3e89e71cb39cef8dbaddbe6492c217ef
treea330abc5d56211abad0da1386d9df4093c15360c
parent6a28f363d3904713a0dd0e101c16bc656504d58f
x86/pmem: Fix platform-device leak in error path

[ 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>
arch/x86/kernel/pmem.c