mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] firmware/sysfb: fix an error code in sysfb_init()
@ 2024-02-22  6:13 Dan Carpenter
  2024-02-22  8:10 ` Thomas Zimmermann
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-02-22  6:13 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: Javier Martinez Canillas, Helge Deller, Huacai Chen,
	Ard Biesheuvel, Hans de Goede, linux-kernel, kernel-janitors

This error path accidentally returns success when it should preserve the
error code from sysfb_parent_dev().

Fixes: 4e754597d603 ("firmware/sysfb: Create firmware device only for enabled PCI devices")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/firmware/sysfb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c
index a6b48703dc9e..880ffcb50088 100644
--- a/drivers/firmware/sysfb.c
+++ b/drivers/firmware/sysfb.c
@@ -127,8 +127,10 @@ static __init int sysfb_init(void)
 	sysfb_apply_efi_quirks();
 
 	parent = sysfb_parent_dev(si);
-	if (IS_ERR(parent))
+	if (IS_ERR(parent)) {
+		ret = PTR_ERR(parent);
 		goto unlock_mutex;
+	}
 
 	/* try to create a simple-framebuffer device */
 	compatible = sysfb_parse_mode(si, &mode);
-- 
2.43.0


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

* Re: [PATCH] firmware/sysfb: fix an error code in sysfb_init()
  2024-02-22  6:13 [PATCH] firmware/sysfb: fix an error code in sysfb_init() Dan Carpenter
@ 2024-02-22  8:10 ` Thomas Zimmermann
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2024-02-22  8:10 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Javier Martinez Canillas, Helge Deller, Huacai Chen,
	Ard Biesheuvel, Hans de Goede, linux-kernel, kernel-janitors



Am 22.02.24 um 07:13 schrieb Dan Carpenter:
> This error path accidentally returns success when it should preserve the
> error code from sysfb_parent_dev().

Thanks! I'll land the patch via drm-misc.

>
> Fixes: 4e754597d603 ("firmware/sysfb: Create firmware device only for enabled PCI devices")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/firmware/sysfb.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c
> index a6b48703dc9e..880ffcb50088 100644
> --- a/drivers/firmware/sysfb.c
> +++ b/drivers/firmware/sysfb.c
> @@ -127,8 +127,10 @@ static __init int sysfb_init(void)
>   	sysfb_apply_efi_quirks();
>   
>   	parent = sysfb_parent_dev(si);
> -	if (IS_ERR(parent))
> +	if (IS_ERR(parent)) {
> +		ret = PTR_ERR(parent);
>   		goto unlock_mutex;
> +	}
>   
>   	/* try to create a simple-framebuffer device */
>   	compatible = sysfb_parse_mode(si, &mode);

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


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

end of thread, other threads:[~2024-02-22  8:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-22  6:13 [PATCH] firmware/sysfb: fix an error code in sysfb_init() Dan Carpenter
2024-02-22  8:10 ` Thomas Zimmermann

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

all inboxes | Powered by JetHome®