]> 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)
commit5ebcf011bb3d834cb31ac631041324c0c2bd6a2c
tree689f840a1e5e2e8bdf113bcaec0e6563813ba951
parent08aafa0d475a08e31a13403e9df41c7179f4bdcd
x86/pmem: Fix platform-device leak in error path

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

Fixes: 7b1efaf5af14 ("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