mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
wan: pc300too: abort path on failure
[ Upstream commit 2a39e7aa8a ]
In function pc300_pci_init_one(), on the ioremap error path, function
pc300_pci_remove_one() is called to free the allocated memory. However,
the path is not terminated, and the freed memory will be used later,
resulting in use-after-free bugs. This path fixes the bug.
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
185c88b1ef
commit
eff9431caf
@@ -347,6 +347,7 @@ static int pc300_pci_init_one(struct pci_dev *pdev,
|
||||
card->rambase == NULL) {
|
||||
pr_err("ioremap() failed\n");
|
||||
pc300_pci_remove_one(pdev);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* PLX PCI 9050 workaround for local configuration register read bug */
|
||||
|
||||
Reference in New Issue
Block a user