Commit ae90cc82 authored by Evgeny Novikov's avatar Evgeny Novikov Committed by Felipe Balbi

usb: gadget: net2272: skip BAR1 on error handling paths in probe

net2272_rdk1_probe() skips "i == 1" (BAR1) during allocation of
resources. The patch does this on error hanling paths as well.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: default avatarEvgeny Novikov <novikov@ispras.ru>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent 75ae051e
...@@ -2370,6 +2370,8 @@ net2272_rdk1_probe(struct pci_dev *pdev, struct net2272 *dev) ...@@ -2370,6 +2370,8 @@ net2272_rdk1_probe(struct pci_dev *pdev, struct net2272 *dev)
err: err:
while (--i >= 0) { while (--i >= 0) {
if (i == 1)
continue; /* BAR1 unused */
iounmap(mem_mapped_addr[i]); iounmap(mem_mapped_addr[i]);
release_mem_region(pci_resource_start(pdev, i), release_mem_region(pci_resource_start(pdev, i),
pci_resource_len(pdev, i)); pci_resource_len(pdev, i));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment