firmware: sysfb: fix platform-device leak in error path
authorJohan Hovold <johan@kernel.org>
Thu, 3 Mar 2022 18:05:19 +0000 (19:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:22:51 +0000 (14:22 +0200)
commitb3e38f939ab4d0d86f56bff3362c3f88c4b2ad32
tree3c8cea67bdcb4a589d9fb54f0861c9320c86f72b
parent0dff5664b867109ef5467bc77a1d4c41f36b3e50
firmware: sysfb: fix platform-device leak in error path

commit 202c08914ba50dd324e42d5ad99535a89f242560 upstream.

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

Fixes: 0589e8889dce ("drivers/firmware: Add missing platform_device_put() in sysfb_create_simplefb")
Fixes: 8633ef82f101 ("drivers/firmware: consolidate EFI framebuffer setup for all arches")
Cc: stable@vger.kernel.org # 5.14
Cc: Miaoqian Lin <linmq006@gmail.com>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20220303180519.3117-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/sysfb_simplefb.c