Message ID | 1492940315-1462-1-git-send-email-bianpan201602@163.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Pan Bian <bianpan201602@163.com> Date: Sun, 23 Apr 2017 17:38:35 +0800 > From: Pan Bian <bianpan2016@163.com> > > 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> Applied.
diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c index e1dd1ec..b9b934b 100644 --- a/drivers/net/wan/pc300too.c +++ b/drivers/net/wan/pc300too.c @@ -346,6 +346,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 */