From: Dan Carpenter dan.carpenter@linaro.org
mainline inclusion from mainline-v6.9-rc1 commit 9fa2679b7fe1bf4e6010051767d3c163b3aee68b category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAR4KI CVE: CVE-2024-46698
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
--------------------------------
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") Reviewed-by: Thomas Zimmermann tzimmermann@suse.de Signed-off-by: Dan Carpenter dan.carpenter@linaro.org Signed-off-by: Thomas Zimmermann tzimmermann@suse.de Link: https://patchwork.freedesktop.org/patch/msgid/aaaa2e13-849b-41a0-8186-25f3d2... Signed-off-by: dinglongwei dinglongwei1@huawei.com --- 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 8b293e4c8c56..ac4680dc463f 100644 --- a/drivers/firmware/sysfb.c +++ b/drivers/firmware/sysfb.c @@ -134,8 +134,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);