From: Greg Kroah-Hartman Date: Fri, 15 May 2026 07:47:15 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v5.10.256~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd6d1f0eab0610a0789cbe3cf1172c6a75efd9e5;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: media-dib8000-avoid-division-by-0-in-dib8000_set_dds.patch media-i2c-imx412-assert-reset-gpio-during-probe.patch media-i2c-ov08d10-fix-image-vertical-start-setting.patch media-omap3isp-drop-the-use-count-of-v4l2-pipeline.patch media-pci-zoran-fix-potential-memory-leak-in-zoran_probe.patch spi-mtk-nor-fix-controller-deregistration.patch --- diff --git a/queue-6.1/media-dib8000-avoid-division-by-0-in-dib8000_set_dds.patch b/queue-6.1/media-dib8000-avoid-division-by-0-in-dib8000_set_dds.patch new file mode 100644 index 0000000000..88b8f577db --- /dev/null +++ b/queue-6.1/media-dib8000-avoid-division-by-0-in-dib8000_set_dds.patch @@ -0,0 +1,47 @@ +From dde3c37af95cd6fa301c4906f33d627bc9dd874c Mon Sep 17 00:00:00 2001 +From: Sergey Shtylyov +Date: Fri, 6 Feb 2026 17:22:26 +0300 +Subject: media: dib8000: avoid division by 0 in dib8000_set_dds() + +From: Sergey Shtylyov + +commit dde3c37af95cd6fa301c4906f33d627bc9dd874c upstream. + +In dib8000_set_dds(), 1 << 26 (67108864) divided by e.g. 1 apparently can't +fit into 16-bit variable unit_khz_dds_val, being truncated to 0; this will +cause division by 0 while calling dprintk() with debugging enabled (via the +module parameter). Use s32 instead of s16 to declare the variable, getting +rid of the cast to u16 in the *else* branch as well... + +Found by Linux Verification Center (linuxtesting.org) with the Svace static +analysis tool. + +Fixes: 173a64cb3fcf ("[media] dib8000: enhancement") +Cc: stable@vger.kernel.org +Signed-off-by: Sergey Shtylyov +Signed-off-by: Hans Verkuil +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/dvb-frontends/dib8000.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/media/dvb-frontends/dib8000.c ++++ b/drivers/media/dvb-frontends/dib8000.c +@@ -2694,7 +2694,7 @@ static void dib8000_viterbi_state(struct + + static void dib8000_set_dds(struct dib8000_state *state, s32 offset_khz) + { +- s16 unit_khz_dds_val; ++ s32 unit_khz_dds_val; + u32 abs_offset_khz = abs(offset_khz); + u32 dds = state->cfg.pll->ifreq & 0x1ffffff; + u8 invert = !!(state->cfg.pll->ifreq & (1 << 25)); +@@ -2715,7 +2715,7 @@ static void dib8000_set_dds(struct dib80 + dds = (1<<26) - dds; + } else { + ratio = 2; +- unit_khz_dds_val = (u16) (67108864 / state->cfg.pll->internal); ++ unit_khz_dds_val = 67108864 / state->cfg.pll->internal; + + if (offset_khz < 0) + unit_khz_dds_val *= -1; diff --git a/queue-6.1/media-i2c-imx412-assert-reset-gpio-during-probe.patch b/queue-6.1/media-i2c-imx412-assert-reset-gpio-during-probe.patch new file mode 100644 index 0000000000..b8d61b962c --- /dev/null +++ b/queue-6.1/media-i2c-imx412-assert-reset-gpio-during-probe.patch @@ -0,0 +1,34 @@ +From 8467c5ff5acae28513bc1e0af535e06b41b04344 Mon Sep 17 00:00:00 2001 +From: Wenmeng Liu +Date: Fri, 23 Jan 2026 17:19:55 +0800 +Subject: media: i2c: imx412: Assert reset GPIO during probe + +From: Wenmeng Liu + +commit 8467c5ff5acae28513bc1e0af535e06b41b04344 upstream. + +Assert the reset GPIO before first power up. This avoids a mismatch where +the first power up (when the reset GPIO defaults deasserted) differs from +subsequent cycles. + +Signed-off-by: Wenmeng Liu +Fixes: 9214e86c0cc1 ("media: i2c: Add imx412 camera sensor driver") +Cc: stable@vger.kernel.org +Signed-off-by: Sakari Ailus +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/i2c/imx412.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/i2c/imx412.c ++++ b/drivers/media/i2c/imx412.c +@@ -934,7 +934,7 @@ static int imx412_parse_hw_config(struct + + /* Request optional reset pin */ + imx412->reset_gpio = devm_gpiod_get_optional(imx412->dev, "reset", +- GPIOD_OUT_LOW); ++ GPIOD_OUT_HIGH); + if (IS_ERR(imx412->reset_gpio)) { + dev_err(imx412->dev, "failed to get reset gpio %ld\n", + PTR_ERR(imx412->reset_gpio)); diff --git a/queue-6.1/media-i2c-ov08d10-fix-image-vertical-start-setting.patch b/queue-6.1/media-i2c-ov08d10-fix-image-vertical-start-setting.patch new file mode 100644 index 0000000000..4d250927c0 --- /dev/null +++ b/queue-6.1/media-i2c-ov08d10-fix-image-vertical-start-setting.patch @@ -0,0 +1,67 @@ +From 5d150fa0f16096d736bd24d13e04495da5116fab Mon Sep 17 00:00:00 2001 +From: Matthias Fend +Date: Tue, 24 Mar 2026 11:41:36 +0100 +Subject: media: i2c: ov08d10: fix image vertical start setting + +From: Matthias Fend + +commit 5d150fa0f16096d736bd24d13e04495da5116fab upstream. + +The current settings for the "image vertical start" register appear to be +incorrect. While this only results in an incorrect start line for native +modes, this faulty setting causes actual problems in binning mode. At least +on an i.MX8MP test system, only corrupted frames could be received. +To correct this, the recommended settings from the reference register sets +are used for all modes. Since this shifts the start by one line, the Bayer +pattern also changes, which has also been corrected. + +Fixes: 7be91e02ed57 ("media: i2c: Add ov08d10 camera sensor driver") +Cc: stable@vger.kernel.org +Signed-off-by: Matthias Fend +Signed-off-by: Sakari Ailus +Signed-off-by: Hans Verkuil +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/i2c/ov08d10.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/media/i2c/ov08d10.c ++++ b/drivers/media/i2c/ov08d10.c +@@ -217,7 +217,7 @@ static const struct ov08d10_reg lane_2_m + {0x9a, 0x30}, + {0xa8, 0x02}, + {0xfd, 0x02}, +- {0xa1, 0x01}, ++ {0xa1, 0x00}, + {0xa2, 0x09}, + {0xa3, 0x9c}, + {0xa5, 0x00}, +@@ -335,7 +335,7 @@ static const struct ov08d10_reg lane_2_m + {0x9a, 0x30}, + {0xa8, 0x02}, + {0xfd, 0x02}, +- {0xa1, 0x09}, ++ {0xa1, 0x08}, + {0xa2, 0x09}, + {0xa3, 0x90}, + {0xa5, 0x08}, +@@ -467,7 +467,7 @@ static const struct ov08d10_reg lane_2_m + {0xaa, 0xd0}, + {0xab, 0x06}, + {0xac, 0x68}, +- {0xa1, 0x09}, ++ {0xa1, 0x04}, + {0xa2, 0x04}, + {0xa3, 0xc8}, + {0xa5, 0x04}, +@@ -615,8 +615,8 @@ static const struct ov08d10_lane_cfg lan + static u32 ov08d10_get_format_code(struct ov08d10 *ov08d10) + { + static const u32 codes[2][2] = { +- { MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SRGGB10_1X10}, +- { MEDIA_BUS_FMT_SBGGR10_1X10, MEDIA_BUS_FMT_SGBRG10_1X10}, ++ { MEDIA_BUS_FMT_SBGGR10_1X10, MEDIA_BUS_FMT_SGBRG10_1X10 }, ++ { MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SRGGB10_1X10 }, + }; + + return codes[ov08d10->vflip->val][ov08d10->hflip->val]; diff --git a/queue-6.1/media-omap3isp-drop-the-use-count-of-v4l2-pipeline.patch b/queue-6.1/media-omap3isp-drop-the-use-count-of-v4l2-pipeline.patch new file mode 100644 index 0000000000..0c8c34511e --- /dev/null +++ b/queue-6.1/media-omap3isp-drop-the-use-count-of-v4l2-pipeline.patch @@ -0,0 +1,32 @@ +From 9da49bd9d4224035cff39b40d7395310abb10201 Mon Sep 17 00:00:00 2001 +From: Haoxiang Li +Date: Mon, 26 Jan 2026 09:44:12 +0800 +Subject: media: omap3isp: drop the use count of v4l2 pipeline + +From: Haoxiang Li + +commit 9da49bd9d4224035cff39b40d7395310abb10201 upstream. + +In isp_video_open(), drop the use count of v4l2 +pipeline if vb2_queue_init() fails. + +Fixes: 8fd390b89cc8 ("media: Split v4l2_pipeline_pm_use into v4l2_pipeline_pm_{get, put}") +Cc: stable@vger.kernel.org +Signed-off-by: Haoxiang Li +Signed-off-by: Sakari Ailus +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/ti/omap3isp/ispvideo.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/media/platform/ti/omap3isp/ispvideo.c ++++ b/drivers/media/platform/ti/omap3isp/ispvideo.c +@@ -1328,6 +1328,7 @@ static int isp_video_open(struct file *f + + ret = vb2_queue_init(&handle->queue); + if (ret < 0) { ++ v4l2_pipeline_pm_put(&video->video.entity); + omap3isp_put(video->isp); + goto done; + } diff --git a/queue-6.1/media-pci-zoran-fix-potential-memory-leak-in-zoran_probe.patch b/queue-6.1/media-pci-zoran-fix-potential-memory-leak-in-zoran_probe.patch new file mode 100644 index 0000000000..a853de9257 --- /dev/null +++ b/queue-6.1/media-pci-zoran-fix-potential-memory-leak-in-zoran_probe.patch @@ -0,0 +1,33 @@ +From 8ea21435fe36fb853706f4935d78bc11beb63fb4 Mon Sep 17 00:00:00 2001 +From: Abdun Nihaal +Date: Thu, 12 Mar 2026 18:02:56 +0530 +Subject: media: pci: zoran: fix potential memory leak in zoran_probe() + +From: Abdun Nihaal + +commit 8ea21435fe36fb853706f4935d78bc11beb63fb4 upstream. + +The memory allocated for codec in videocodec_attach() is not freed in +one of the error paths, due to an incorrect goto label. Fix the label +to free it on error. + +Fixes: 8f7cc5c0b0eb ("media: staging: media: zoran: introduce zoran_i2c_init") +Cc: stable@vger.kernel.org +Signed-off-by: Abdun Nihaal +Signed-off-by: Hans Verkuil +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/pci/zoran/zoran_card.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/pci/zoran/zoran_card.c ++++ b/drivers/media/pci/zoran/zoran_card.c +@@ -1377,7 +1377,7 @@ static int zoran_probe(struct pci_dev *p + } + if (zr->codec->type != zr->card.video_codec) { + pci_err(pdev, "%s - wrong codec\n", __func__); +- goto zr_unreg_videocodec; ++ goto zr_detach_codec; + } + } + if (zr->card.video_vfe != 0) { diff --git a/queue-6.1/series b/queue-6.1/series index d9b272dab6..e89f305c84 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -398,3 +398,9 @@ regulator-act8945a-fix-of-node-reference-imbalance.patch regulator-bd9571mwv-fix-of-node-reference-imbalance.patch media-saa7164-add-ioremap-return-checks-and-cleanups.patch platform-x86-hp-wmi-ignore-backlight-and-fnlock-events.patch +media-pci-zoran-fix-potential-memory-leak-in-zoran_probe.patch +media-dib8000-avoid-division-by-0-in-dib8000_set_dds.patch +media-i2c-imx412-assert-reset-gpio-during-probe.patch +media-i2c-ov08d10-fix-image-vertical-start-setting.patch +media-omap3isp-drop-the-use-count-of-v4l2-pipeline.patch +spi-mtk-nor-fix-controller-deregistration.patch diff --git a/queue-6.1/spi-mtk-nor-fix-controller-deregistration.patch b/queue-6.1/spi-mtk-nor-fix-controller-deregistration.patch new file mode 100644 index 0000000000..8604b5488a --- /dev/null +++ b/queue-6.1/spi-mtk-nor-fix-controller-deregistration.patch @@ -0,0 +1,43 @@ +From 76336f24934621db286cabb20b483773ee01dcaa Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 10 Apr 2026 10:17:32 +0200 +Subject: spi: mtk-nor: fix controller deregistration + +From: Johan Hovold + +commit 76336f24934621db286cabb20b483773ee01dcaa upstream. + +Make sure to deregister the controller before disabling underlying +resources like clocks during driver unbind. + +Fixes: 881d1ee9fe81 ("spi: add support for mediatek spi-nor controller") +Cc: stable@vger.kernel.org # 5.7 +Cc: Chuanhong Guo +Signed-off-by: Johan Hovold +Link: https://patch.msgid.link/20260410081757.503099-3-johan@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-mtk-nor.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/spi/spi-mtk-nor.c ++++ b/drivers/spi/spi-mtk-nor.c +@@ -900,7 +900,7 @@ static int mtk_nor_probe(struct platform + pm_runtime_enable(&pdev->dev); + pm_runtime_get_noresume(&pdev->dev); + +- ret = devm_spi_register_controller(&pdev->dev, ctlr); ++ ret = spi_register_controller(ctlr); + if (ret < 0) + goto err_probe; + +@@ -926,6 +926,8 @@ static int mtk_nor_remove(struct platfor + struct spi_controller *ctlr = dev_get_drvdata(&pdev->dev); + struct mtk_nor *sp = spi_controller_get_devdata(ctlr); + ++ spi_unregister_controller(ctlr); ++ + pm_runtime_disable(&pdev->dev); + pm_runtime_set_suspended(&pdev->dev); + pm_runtime_dont_use_autosuspend(&pdev->dev);