]> git.baikalelectronics.ru Git - 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)
committerBorislav Petkov <bp@suse.de>
Mon, 20 Jun 2022 16:01:16 +0000 (18:01 +0200)
commit576bab8383e2e5178a59c21efe15f6e3a6367c90
tree689f840a1e5e2e8bdf113bcaec0e6563813ba951
parent4764e99deee460568d59e6c88fcf402440c6a616
x86/pmem: Fix platform-device leak in error path

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

Fixes: 7d001475102f ("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
arch/x86/kernel/pmem.c