public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/firmware: Add missing platform_device_put() in sysfb_create_simplefb
@ 2021-12-31  8:04 Miaoqian Lin
  2022-01-13 11:16 ` Javier Martinez Canillas
  0 siblings, 1 reply; 5+ messages in thread
From: Miaoqian Lin @ 2021-12-31  8:04 UTC (permalink / raw)
  Cc: linmq006, Thomas Zimmermann, Daniel Vetter, Borislav Petkov,
	Javier Martinez Canillas, Greg Kroah-Hartman, linux-kernel

Add the missing platform_device_put() before return from
sysfb_create_simplefb() in the error handling case.

Fixes: 8633ef8 ("drivers/firmware: consolidate EFI framebuffer setup for all arches")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/firmware/sysfb_simplefb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/sysfb_simplefb.c b/drivers/firmware/sysfb_simplefb.c
index b86761904949..303a491e520d 100644
--- a/drivers/firmware/sysfb_simplefb.c
+++ b/drivers/firmware/sysfb_simplefb.c
@@ -113,12 +113,16 @@ __init int sysfb_create_simplefb(const struct screen_info *si,
 	sysfb_apply_efi_quirks(pd);
 
 	ret = platform_device_add_resources(pd, &res, 1);
-	if (ret)
+	if (ret) {
+		platform_device_put(pd);
 		return ret;
+	}
 
 	ret = platform_device_add_data(pd, mode, sizeof(*mode));
-	if (ret)
+	if (ret) {
+		platform_device_put(pd);
 		return ret;
+	}
 
 	return platform_device_add(pd);
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-04 15:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-31  8:04 [PATCH] drivers/firmware: Add missing platform_device_put() in sysfb_create_simplefb Miaoqian Lin
2022-01-13 11:16 ` Javier Martinez Canillas
2022-01-16 12:16   ` [PATCH v2] " Miaoqian Lin
2022-01-16 17:31     ` Javier Martinez Canillas
2022-02-04 15:41       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox