Skip to content

Commit 0589e88

Browse files
Yuuoniygregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 358fcf5 commit 0589e88

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/firmware/sysfb_simplefb.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,16 @@ __init int sysfb_create_simplefb(const struct screen_info *si,
113113
sysfb_apply_efi_quirks(pd);
114114

115115
ret = platform_device_add_resources(pd, &res, 1);
116-
if (ret)
116+
if (ret) {
117+
platform_device_put(pd);
117118
return ret;
119+
}
118120

119121
ret = platform_device_add_data(pd, mode, sizeof(*mode));
120-
if (ret)
122+
if (ret) {
123+
platform_device_put(pd);
121124
return ret;
125+
}
122126

123127
return platform_device_add(pd);
124128
}

0 commit comments

Comments
 (0)