diff options
author | Andy Shevchenko <[email protected]> | 2021-06-07 23:50:05 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2021-06-09 10:56:08 +0200 |
commit | 1a85b350a7741776a406005b943e3dec02c424ed (patch) | |
tree | c49a50688c28d3a914b5646e57c76cc5b9784fee | |
parent | 5ab14ab1f2db24ffae6c5c39a689660486962e6e (diff) |
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 <[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]>
-rw-r--r-- | drivers/usb/typec/mux/intel_pmc_mux.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |