提交 0a518333 编写于 作者: A Andy Shevchenko 提交者: Wang ShaoBo

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

stable inclusion
from stable-v5.10.44
commit 6900ef1b1095e2ffa6538895017a5408e4706e34
bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=410
CVE: NA

-------------------------------------------------

commit 1a85b350 upstream.

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: 6701adfa ("usb: typec: driver for Intel PMC mux control")
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210607205007.71458-1-andy.shevchenko@gmail.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYuan Yao <yaoyuan_1999_1@163.com>
Reviewed-by: Jian Cheng <cj.chengjian(a)huawei.com>
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
上级 bac32994
......@@ -623,8 +623,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册