patch "usb: typec: intel_pmc_mux: Put fwnode in error case during ->probe()" added to usb-linus

From: <gregkh@linuxfoundation.org>
Date: 2021-06-09 08:56:26
Subsystem: the rest, usb subsystem, usb typec class, usb typec intel pmc mux driver · Maintainers: Linus Torvalds, Greg Kroah-Hartman, Heikki Krogerus

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

    usb: typec: intel_pmc_mux: Put fwnode in error case during ->probe()

to my usb git tree which can be found at
    git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.

If you have any questions about this process, please let me know.


From 1a85b350a7741776a406005b943e3dec02c424ed Mon Sep 17 00:00:00 2001
From: Andy Shevchenko <redacted>
Date: Mon, 7 Jun 2021 23:50:05 +0300
Subject: usb: typec: intel_pmc_mux: Put fwnode in error case during ->probe()

device_get_next_child_node() bumps a reference counting of a returned variable.
We have to balance it whenever we return to the caller.

Fixes: 6701adfa9693 ("usb: typec: driver for Intel PMC mux control")
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Andy Shevchenko <redacted>
Cc: stable <redacted>
Link: https://lore.kernel.org/r/20210607205007.71458-1-andy.shevchenko@gmail.com (local)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/typec/mux/intel_pmc_mux.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
index 46a25b8db72e..96d8c5a04680 100644
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
@@ -636,8 +636,10 @@ static int pmc_usb_probe(struct platform_device *pdev)
 			break;
 
 		ret = pmc_usb_register_port(pmc, i, fwnode);
-		if (ret)
+		if (ret) {
+			fwnode_handle_put(fwnode);
 			goto err_remove_ports;
+		}
 	}
 
 	platform_set_drvdata(pdev, pmc);
-- 
2.32.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help