diff options
author | Pan Bian <bianpan2016@163.com> | 2017-04-23 11:38:35 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-24 21:51:31 +0200 |
commit | 2a39e7aa8a98f777f0732ca7125b6c9668791760 (patch) | |
tree | a398faf313dce384ba75894045ca7604c0868be0 /drivers/net/wan | |
parent | tipc: check return value of nlmsg_new (diff) | |
download | linux-2a39e7aa8a98f777f0732ca7125b6c9668791760.tar.xz linux-2a39e7aa8a98f777f0732ca7125b6c9668791760.zip |
wan: pc300too: abort path on failure
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>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/pc300too.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c index e1dd1ec18d64..b9b934b7713c 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 */ |