From: Greg Kroah-Hartman Date: Fri, 9 Jan 2026 11:02:09 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v6.1.160~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a577914e5d31445e83eda8bff05aee3a70c666f1;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: net-ethtool-fix-the-error-condition-in-ethtool_get_phy_stats_ethtool.patch usb-gadget-lpc32xx_udc-fix-clock-imbalance-in-error-path.patch --- diff --git a/queue-5.15/net-ethtool-fix-the-error-condition-in-ethtool_get_phy_stats_ethtool.patch b/queue-5.15/net-ethtool-fix-the-error-condition-in-ethtool_get_phy_stats_ethtool.patch new file mode 100644 index 0000000000..7bd7049519 --- /dev/null +++ b/queue-5.15/net-ethtool-fix-the-error-condition-in-ethtool_get_phy_stats_ethtool.patch @@ -0,0 +1,38 @@ +From 0dcc53abf58d572d34c5313de85f607cd33fc691 Mon Sep 17 00:00:00 2001 +From: Su Hui +Date: Wed, 5 Jun 2024 11:47:43 +0800 +Subject: net: ethtool: fix the error condition in ethtool_get_phy_stats_ethtool() + +From: Su Hui + +commit 0dcc53abf58d572d34c5313de85f607cd33fc691 upstream. + +Clang static checker (scan-build) warning: +net/ethtool/ioctl.c:line 2233, column 2 +Called function pointer is null (null dereference). + +Return '-EOPNOTSUPP' when 'ops->get_ethtool_phy_stats' is NULL to fix +this typo error. + +Fixes: 201ed315f967 ("net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers") +Signed-off-by: Su Hui +Reviewed-by: Przemek Kitszel +Reviewed-by: Hariprasad Kelam +Link: https://lore.kernel.org/r/20240605034742.921751-1-suhui@nfschina.com +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +--- + net/ethtool/ioctl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/ethtool/ioctl.c ++++ b/net/ethtool/ioctl.c +@@ -2111,7 +2111,7 @@ static int ethtool_get_phy_stats_ethtool + const struct ethtool_ops *ops = dev->ethtool_ops; + int n_stats, ret; + +- if (!ops || !ops->get_sset_count || ops->get_ethtool_phy_stats) ++ if (!ops || !ops->get_sset_count || !ops->get_ethtool_phy_stats) + return -EOPNOTSUPP; + + n_stats = ops->get_sset_count(dev, ETH_SS_PHY_STATS); diff --git a/queue-5.15/series b/queue-5.15/series index 0d8ce20310..da209e3027 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -499,3 +499,5 @@ ext4-factor-out-ext4_hash_info_init.patch ext4-fix-error-message-when-rejecting-the-default-hash.patch firmware-arm_scmi-fix-unused-notifier-block-in-unregister.patch revert-iommu-amd-skip-enabling-command-event-buffers-for-kdump.patch +net-ethtool-fix-the-error-condition-in-ethtool_get_phy_stats_ethtool.patch +usb-gadget-lpc32xx_udc-fix-clock-imbalance-in-error-path.patch diff --git a/queue-5.15/usb-gadget-lpc32xx_udc-fix-clock-imbalance-in-error-path.patch b/queue-5.15/usb-gadget-lpc32xx_udc-fix-clock-imbalance-in-error-path.patch new file mode 100644 index 0000000000..2d848beb6a --- /dev/null +++ b/queue-5.15/usb-gadget-lpc32xx_udc-fix-clock-imbalance-in-error-path.patch @@ -0,0 +1,102 @@ +From 782be79e4551550d7a82b1957fc0f7347e6d461f Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 18 Dec 2025 16:35:15 +0100 +Subject: usb: gadget: lpc32xx_udc: fix clock imbalance in error path + +From: Johan Hovold + +commit 782be79e4551550d7a82b1957fc0f7347e6d461f upstream. + +A recent change fixing a device reference leak introduced a clock +imbalance by reusing an error path so that the clock may be disabled +before having been enabled. + +Note that the clock framework allows for passing in NULL clocks so there +is no risk for a NULL pointer dereference. + +Also drop the bogus I2C client NULL check added by the offending commit +as the pointer has already been verified to be non-NULL. + +Fixes: c84117912bdd ("USB: lpc32xx_udc: Fix error handling in probe") +Cc: stable@vger.kernel.org +Cc: Ma Ke +Signed-off-by: Johan Hovold +Reviewed-by: Vladimir Zapolskiy +Link: https://patch.msgid.link/20251218153519.19453-2-johan@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/gadget/udc/lpc32xx_udc.c | 19 +++++++++---------- + 1 file changed, 9 insertions(+), 10 deletions(-) + +--- a/drivers/usb/gadget/udc/lpc32xx_udc.c ++++ b/drivers/usb/gadget/udc/lpc32xx_udc.c +@@ -3025,7 +3025,7 @@ static int lpc32xx_udc_probe(struct plat + pdev->dev.dma_mask = &lpc32xx_usbd_dmamask; + retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); + if (retval) +- goto i2c_fail; ++ goto err_put_client; + + udc->board = &lpc32xx_usbddata; + +@@ -3045,7 +3045,7 @@ static int lpc32xx_udc_probe(struct plat + udc->udp_irq[i] = platform_get_irq(pdev, i); + if (udc->udp_irq[i] < 0) { + retval = udc->udp_irq[i]; +- goto i2c_fail; ++ goto err_put_client; + } + } + +@@ -3053,7 +3053,7 @@ static int lpc32xx_udc_probe(struct plat + if (IS_ERR(udc->udp_baseaddr)) { + dev_err(udc->dev, "IO map failure\n"); + retval = PTR_ERR(udc->udp_baseaddr); +- goto i2c_fail; ++ goto err_put_client; + } + + /* Get USB device clock */ +@@ -3061,14 +3061,14 @@ static int lpc32xx_udc_probe(struct plat + if (IS_ERR(udc->usb_slv_clk)) { + dev_err(udc->dev, "failed to acquire USB device clock\n"); + retval = PTR_ERR(udc->usb_slv_clk); +- goto i2c_fail; ++ goto err_put_client; + } + + /* Enable USB device clock */ + retval = clk_prepare_enable(udc->usb_slv_clk); + if (retval < 0) { + dev_err(udc->dev, "failed to start USB device clock\n"); +- goto i2c_fail; ++ goto err_put_client; + } + + /* Setup deferred workqueue data */ +@@ -3170,9 +3170,10 @@ dma_alloc_fail: + dma_free_coherent(&pdev->dev, UDCA_BUFF_SIZE, + udc->udca_v_base, udc->udca_p_base); + i2c_fail: +- if (udc->isp1301_i2c_client) +- put_device(&udc->isp1301_i2c_client->dev); + clk_disable_unprepare(udc->usb_slv_clk); ++err_put_client: ++ put_device(&udc->isp1301_i2c_client->dev); ++ + dev_err(udc->dev, "%s probe failed, %d\n", driver_name, retval); + + return retval; +@@ -3197,11 +3198,9 @@ static int lpc32xx_udc_remove(struct pla + dma_free_coherent(&pdev->dev, UDCA_BUFF_SIZE, + udc->udca_v_base, udc->udca_p_base); + +- if (udc->isp1301_i2c_client) +- put_device(&udc->isp1301_i2c_client->dev); +- + clk_disable_unprepare(udc->usb_slv_clk); + ++ put_device(&udc->isp1301_i2c_client->dev); + return 0; + } +