[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220116121654.7730-1-linmq006@gmail.com>
Date: Sun, 16 Jan 2022 12:16:54 +0000
From: Miaoqian Lin <linmq006@...il.com>
To: javierm@...hat.com
Cc: bp@...e.de, daniel.vetter@...ll.ch, gregkh@...uxfoundation.org,
linmq006@...il.com, linux-kernel@...r.kernel.org,
tzimmermann@...e.de
Subject: [PATCH v2] drivers/firmware: Add missing platform_device_put() in sysfb_create_simplefb
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@...il.com>
---
Changes in v2:
- Use goto label to avoid duplicating the error code logic.
---
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..46d776c29174 100644
--- a/drivers/firmware/sysfb_simplefb.c
+++ b/drivers/firmware/sysfb_simplefb.c
@@ -114,11 +114,15 @@ __init int sysfb_create_simplefb(const struct screen_info *si,
ret = platform_device_add_resources(pd, &res, 1);
if (ret)
- return ret;
+ goto pdev_put;
ret = platform_device_add_data(pd, mode, sizeof(*mode));
if (ret)
- return ret;
+ goto pdev_put;
return platform_device_add(pd);
+
+pdev_put:
+ platform_device_put(pd);
+ return ret;
}
--
2.17.1
Powered by blists - more mailing lists