Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee157a7

Browse files
Huang Guobingregkh
authored andcommitted
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: Jiri Slaby <[email protected]> Signed-off-by: Huang Guobin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 570f749 commit ee157a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/icom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ static int icom_probe(struct pci_dev *dev,
15011501
retval = pci_read_config_dword(dev, PCI_COMMAND, &command_reg);
15021502
if (retval) {
15031503
dev_err(&dev->dev, "PCI Config read FAILED\n");
1504-
return retval;
1504+
goto probe_exit0;
15051505
}
15061506

15071507
pci_write_config_dword(dev, PCI_COMMAND,

0 commit comments

Comments
 (0)