Skip to content

Commit 1a85b35

Browse files
andy-shevgregkh
authored andcommitted
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: 6701adf ("usb: typec: driver for Intel PMC mux control") Cc: Heikki Krogerus <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5ab14ab commit 1a85b35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/typec/mux/intel_pmc_mux.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,10 @@ static int pmc_usb_probe(struct platform_device *pdev)
636636
break;
637637

638638
ret = pmc_usb_register_port(pmc, i, fwnode);
639-
if (ret)
639+
if (ret) {
640+
fwnode_handle_put(fwnode);
640641
goto err_remove_ports;
642+
}
641643
}
642644

643645
platform_set_drvdata(pdev, pmc);

0 commit comments

Comments
 (0)