]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:07 +0000 (14:23 +0200)
commite18956ba50234dcb9d7f0ba6242418d5d8880520
treebdeefa0d81601baf380cf827ca0100877fff3b2b
parent1207d6ee90e74433185f31e20f52527cfd4f082a
x86/pmem: Fix platform-device leak in error path

[ Upstream commit 5ebcf011bb3d834cb31ac631041324c0c2bd6a2c ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kernel/pmem.c