forked from mirrors/linux
		
	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: 8633ef82f1 ("drivers/firmware: consolidate EFI framebuffer setup for all arches")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20211231080431.15385-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
			
			
This commit is contained in:
		
							parent
							
								
									358fcf5ddb
								
							
						
					
					
						commit
						0589e8889d
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		|  | @ -113,12 +113,16 @@ __init int sysfb_create_simplefb(const struct screen_info *si, | ||||||
| 	sysfb_apply_efi_quirks(pd); | 	sysfb_apply_efi_quirks(pd); | ||||||
| 
 | 
 | ||||||
| 	ret = platform_device_add_resources(pd, &res, 1); | 	ret = platform_device_add_resources(pd, &res, 1); | ||||||
| 	if (ret) | 	if (ret) { | ||||||
|  | 		platform_device_put(pd); | ||||||
| 		return ret; | 		return ret; | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	ret = platform_device_add_data(pd, mode, sizeof(*mode)); | 	ret = platform_device_add_data(pd, mode, sizeof(*mode)); | ||||||
| 	if (ret) | 	if (ret) { | ||||||
|  | 		platform_device_put(pd); | ||||||
| 		return ret; | 		return ret; | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	return platform_device_add(pd); | 	return platform_device_add(pd); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Miaoqian Lin
						Miaoqian Lin