提交 ee157a79 编写于 作者: H Huang Guobin 提交者: Greg Kroah-Hartman

tty: Fix a possible resource leak in icom_probe

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>
上级 570f749f
...@@ -1501,7 +1501,7 @@ static int icom_probe(struct pci_dev *dev, ...@@ -1501,7 +1501,7 @@ static int icom_probe(struct pci_dev *dev,
retval = pci_read_config_dword(dev, PCI_COMMAND, &command_reg); retval = pci_read_config_dword(dev, PCI_COMMAND, &command_reg);
if (retval) { if (retval) {
dev_err(&dev->dev, "PCI Config read FAILED\n"); dev_err(&dev->dev, "PCI Config read FAILED\n");
return retval; goto probe_exit0;
} }
pci_write_config_dword(dev, PCI_COMMAND, pci_write_config_dword(dev, PCI_COMMAND,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册