Patch "mt76: mt7921: Fix the error handling path of mt7921_pci_probe()" has been added to the 5.15-stable tree

gregkh at linuxfoundation.org gregkh at linuxfoundation.org
Sat Jul 23 08:22:46 PDT 2022


This is a note to let you know that I've just added the patch titled

    mt76: mt7921: Fix the error handling path of mt7921_pci_probe()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mt76-mt7921-fix-the-error-handling-path-of-mt7921_pci_probe.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable at vger.kernel.org> know about it.


>From foo at baz Sat Jul 23 05:21:21 PM CEST 2022
From: sean.wang at kernel.org
Date: Fri, 15 Jul 2022 12:59:26 -0700
Subject: mt76: mt7921: Fix the error handling path of mt7921_pci_probe()
To: stable at vger.kernel.org
Cc: linux-wireless at vger.kernel.org, linux-mediatek at lists.infradead.org, linux-kernel at vger.kernel.org, Christophe JAILLET <christophe.jaillet at wanadoo.fr>, Felix Fietkau <nbd at nbd.name>
Message-ID: <768b04c445f39ad1fc166b98be8154bd413f978a.1657915079.git.sean.wang at kernel.org>

From: Christophe JAILLET <christophe.jaillet at wanadoo.fr>

commit 4e90db5e21eb3bb272fe47386dc3506755e209e9 upstream.

In case of error, some resources must be freed, as already done above and
below the devm_kmemdup() and __mt7921e_mcu_drv_pmctrl() calls added in the
commit in Fixes:.

Fixes: 602cc0c9618a ("mt76: mt7921e: fix possible probe failure after reboot")
Signed-off-by: Christophe JAILLET <christophe.jaillet at wanadoo.fr>
Signed-off-by: Felix Fietkau <nbd at nbd.name>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 drivers/net/wireless/mediatek/mt76/mt7921/pci.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
@@ -254,8 +254,10 @@ static int mt7921_pci_probe(struct pci_d
 	dev->bus_ops = dev->mt76.bus;
 	bus_ops = devm_kmemdup(dev->mt76.dev, dev->bus_ops, sizeof(*bus_ops),
 			       GFP_KERNEL);
-	if (!bus_ops)
-		return -ENOMEM;
+	if (!bus_ops) {
+		ret = -ENOMEM;
+		goto err_free_dev;
+	}
 
 	bus_ops->rr = mt7921_rr;
 	bus_ops->wr = mt7921_wr;
@@ -264,7 +266,7 @@ static int mt7921_pci_probe(struct pci_d
 
 	ret = __mt7921e_mcu_drv_pmctrl(dev);
 	if (ret)
-		return ret;
+		goto err_free_dev;
 
 	mdev->rev = (mt7921_l1_rr(dev, MT_HW_CHIPID) << 16) |
 		    (mt7921_l1_rr(dev, MT_HW_REV) & 0xff);


Patches currently in stable-queue which might be from sean.wang at kernel.org are

queue-5.15/revert-mt76-mt7921e-fix-possible-probe-failure-after-reboot.patch
queue-5.15/mt76-mt7921-use-physical-addr-to-unify-register-access.patch
queue-5.15/mt76-mt7921e-fix-possible-probe-failure-after-reboot.patch
queue-5.15/mt76-mt7921-fix-the-error-handling-path-of-mt7921_pci_probe.patch
queue-5.15/revert-mt76-mt7921-fix-the-error-handling-path-of-mt7921_pci_probe.patch



More information about the Linux-mediatek mailing list