From: Sasha Levin Date: Mon, 13 Nov 2023 04:28:55 +0000 (-0500) Subject: Fixes for 4.19 X-Git-Tag: v4.14.330~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5628e0966479034f54677101a0376f26ab94c332;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch b/queue-4.19/fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch new file mode 100644 index 00000000000..0cd0f8991eb --- /dev/null +++ b/queue-4.19/fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch @@ -0,0 +1,38 @@ +From b95a1fc045c95b2725528fb6f752367ff17dedb9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 8 Nov 2023 13:58:42 +0100 +Subject: fbdev: fsl-diu-fb: mark wr_reg_wa() static + +From: Arnd Bergmann + +[ Upstream commit a5035c81847430dfa3482807b07325f29e9e8c09 ] + +wr_reg_wa() is not an appropriate name for a global function, and doesn't need +to be global anyway, so mark it static and avoid the warning: + +drivers/video/fbdev/fsl-diu-fb.c:493:6: error: no previous prototype for 'wr_reg_wa' [-Werror=missing-prototypes] + +Fixes: 0d9dab39fbbe ("powerpc/5121: fsl-diu-fb: fix issue with re-enabling DIU area descriptor") +Signed-off-by: Arnd Bergmann +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/fsl-diu-fb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c +index bc9eb8afc3137..0a86a91614085 100644 +--- a/drivers/video/fbdev/fsl-diu-fb.c ++++ b/drivers/video/fbdev/fsl-diu-fb.c +@@ -495,7 +495,7 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s) + * Workaround for failed writing desc register of planes. + * Needed with MPC5121 DIU rev 2.0 silicon. + */ +-void wr_reg_wa(u32 *reg, u32 val) ++static void wr_reg_wa(u32 *reg, u32 val) + { + do { + out_be32(reg, val); +-- +2.42.0 + diff --git a/queue-4.19/fbdev-imsttfb-fix-a-resource-leak-in-probe.patch b/queue-4.19/fbdev-imsttfb-fix-a-resource-leak-in-probe.patch new file mode 100644 index 00000000000..a8729a43c69 --- /dev/null +++ b/queue-4.19/fbdev-imsttfb-fix-a-resource-leak-in-probe.patch @@ -0,0 +1,89 @@ +From 3388ce9939e3d1d43c04a9d99ebab4935de10192 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Oct 2023 15:05:44 +0300 +Subject: fbdev: imsttfb: fix a resource leak in probe + +From: Dan Carpenter + +[ Upstream commit aba6ab57a910ad4b940c2024d15f2cdbf5b7f76b ] + +I've re-written the error handling but the bug is that if init_imstt() +fails we need to call iounmap(par->cmap_regs). + +Fixes: c75f5a550610 ("fbdev: imsttfb: Fix use after free bug in imsttfb_probe") +Signed-off-by: Dan Carpenter +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/imsttfb.c | 29 ++++++++++++++++------------- + 1 file changed, 16 insertions(+), 13 deletions(-) + +diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c +index 9a9018d143761..30ba79d3dbea4 100644 +--- a/drivers/video/fbdev/imsttfb.c ++++ b/drivers/video/fbdev/imsttfb.c +@@ -1493,8 +1493,8 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + + if (!request_mem_region(addr, size, "imsttfb")) { + printk(KERN_ERR "imsttfb: Can't reserve memory region\n"); +- framebuffer_release(info); +- return -ENODEV; ++ ret = -ENODEV; ++ goto release_info; + } + + switch (pdev->device) { +@@ -1511,36 +1511,39 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + printk(KERN_INFO "imsttfb: Device 0x%x unknown, " + "contact maintainer.\n", pdev->device); + ret = -ENODEV; +- goto error; ++ goto release_mem_region; + } + + info->fix.smem_start = addr; + info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ? + 0x400000 : 0x800000); + if (!info->screen_base) +- goto error; ++ goto release_mem_region; + info->fix.mmio_start = addr + 0x800000; + par->dc_regs = ioremap(addr + 0x800000, 0x1000); + if (!par->dc_regs) +- goto error; ++ goto unmap_screen_base; + par->cmap_regs_phys = addr + 0x840000; + par->cmap_regs = (__u8 *)ioremap(addr + 0x840000, 0x1000); + if (!par->cmap_regs) +- goto error; ++ goto unmap_dc_regs; + info->pseudo_palette = par->palette; + ret = init_imstt(info); + if (ret) +- goto error; ++ goto unmap_cmap_regs; + + pci_set_drvdata(pdev, info); +- return ret; ++ return 0; + +-error: +- if (par->dc_regs) +- iounmap(par->dc_regs); +- if (info->screen_base) +- iounmap(info->screen_base); ++unmap_cmap_regs: ++ iounmap(par->cmap_regs); ++unmap_dc_regs: ++ iounmap(par->dc_regs); ++unmap_screen_base: ++ iounmap(info->screen_base); ++release_mem_region: + release_mem_region(addr, size); ++release_info: + framebuffer_release(info); + return ret; + } +-- +2.42.0 + diff --git a/queue-4.19/fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch b/queue-4.19/fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch new file mode 100644 index 00000000000..a026fe5b899 --- /dev/null +++ b/queue-4.19/fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch @@ -0,0 +1,38 @@ +From 2af749a76680a6fdda309f3a0b8a67ea24b7602a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 27 May 2023 11:37:29 +0200 +Subject: fbdev: imsttfb: Fix error path of imsttfb_probe() + +From: Helge Deller + +[ Upstream commit 518ecb6a209f6ff678aeadf9f2bf870c0982ca85 ] + +Release ressources when init_imstt() returns failure. + +Signed-off-by: Helge Deller +Stable-dep-of: aba6ab57a910 ("fbdev: imsttfb: fix a resource leak in probe") +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/imsttfb.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c +index 4a3f89b223600..9a9018d143761 100644 +--- a/drivers/video/fbdev/imsttfb.c ++++ b/drivers/video/fbdev/imsttfb.c +@@ -1529,8 +1529,10 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + goto error; + info->pseudo_palette = par->palette; + ret = init_imstt(info); +- if (!ret) +- pci_set_drvdata(pdev, info); ++ if (ret) ++ goto error; ++ ++ pci_set_drvdata(pdev, info); + return ret; + + error: +-- +2.42.0 + diff --git a/queue-4.19/fbdev-omapfb-drop-unused-remove-function.patch b/queue-4.19/fbdev-omapfb-drop-unused-remove-function.patch new file mode 100644 index 00000000000..3d90422d12a --- /dev/null +++ b/queue-4.19/fbdev-omapfb-drop-unused-remove-function.patch @@ -0,0 +1,54 @@ +From a041f4288f49063d64c945383d87808e34baa331 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 3 Nov 2023 18:35:58 +0100 +Subject: fbdev: omapfb: Drop unused remove function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +[ Upstream commit fc6699d62f5f4facc3e934efd25892fc36050b70 ] + +OMAP2_VRFB is a bool, so the vrfb driver can never be compiled as a +module. With that __exit_p(vrfb_remove) always evaluates to NULL and +vrfb_remove() is unused. + +If the driver was compilable as a module, it would fail to build because +the type of vrfb_remove() isn't compatible with struct +platform_driver::remove(). (The former returns void, the latter int.) + +Fixes: aa1e49a3752f ("OMAPDSS: VRFB: add omap_vrfb_supported()") +Signed-off-by: Uwe Kleine-König +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/omap2/omapfb/vrfb.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/drivers/video/fbdev/omap2/omapfb/vrfb.c b/drivers/video/fbdev/omap2/omapfb/vrfb.c +index f355ecfac3b18..8f1c2d2e80fdd 100644 +--- a/drivers/video/fbdev/omap2/omapfb/vrfb.c ++++ b/drivers/video/fbdev/omap2/omapfb/vrfb.c +@@ -382,17 +382,10 @@ static int __init vrfb_probe(struct platform_device *pdev) + return 0; + } + +-static void __exit vrfb_remove(struct platform_device *pdev) +-{ +- vrfb_loaded = false; +-} +- + static struct platform_driver vrfb_driver = { + .driver.name = "omapvrfb", +- .remove = __exit_p(vrfb_remove), + }; +- +-module_platform_driver_probe(vrfb_driver, vrfb_probe); ++builtin_platform_driver_probe(vrfb_driver, vrfb_probe); + + MODULE_AUTHOR("Tomi Valkeinen "); + MODULE_DESCRIPTION("OMAP VRFB"); +-- +2.42.0 + diff --git a/queue-4.19/series b/queue-4.19/series index a5ddb458551..57672b7fb93 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -81,3 +81,7 @@ net-smc-fix-dangling-sock-under-state-smc_appfinclos.patch tg3-power-down-device-only-on-system_power_off.patch r8169-respect-userspace-disabling-iff_multicast.patch netfilter-xt_recent-fix-increase-ipv6-literal-buffer.patch +fbdev-omapfb-drop-unused-remove-function.patch +fbdev-imsttfb-fix-error-path-of-imsttfb_probe.patch +fbdev-imsttfb-fix-a-resource-leak-in-probe.patch +fbdev-fsl-diu-fb-mark-wr_reg_wa-static.patch