提交 a0f5ee70 编写于 作者: H Huang Guobin 提交者: Zheng Zengkai

tty: Fix a possible resource leak in icom_probe

stable inclusion
from stable-v5.10.122
commit cb7147afd328c07edeeee287710d8d96ac0459f5
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5W6OE

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cb7147afd328c07edeeee287710d8d96ac0459f5

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

[ Upstream commit ee157a79 ]

When pci_read_config_dword failed, call pci_release_regions() and
pci_disable_device() to recycle the resource previously allocated.
Reviewed-by: NJiri Slaby <jirislaby@kernel.org>
Signed-off-by: NHuang Guobin <huangguobin4@huawei.com>
Link: https://lore.kernel.org/r/20220331091005.3290753-1-huangguobin4@huawei.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 cec1668e
......@@ -1503,7 +1503,7 @@ static int icom_probe(struct pci_dev *dev,
retval = pci_read_config_dword(dev, PCI_COMMAND, &command_reg);
if (retval) {
dev_err(&dev->dev, "PCI Config read FAILED\n");
return retval;
goto probe_exit0;
}
pci_write_config_dword(dev, PCI_COMMAND,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册