Skip to content

Commit

Permalink
wan: pc300too: abort path on failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pan Bian authored and David S. Miller committed Apr 24, 2017
1 parent 78302fd commit 2a39e7a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wan/pc300too.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 2a39e7a

Please sign in to comment.