summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorEvgeny Novikov <novikov@ispras.ru>2020-07-15 19:40:09 +0300
committerFelipe Balbi <balbi@kernel.org>2020-07-24 16:45:12 +0300
commitae90cc8237bf4ee416a326c51052ddcc7918ee43 (patch)
tree63619a22c7a3544c50fd29fc209afd38e35b40cd /drivers/usb
parent75ae051efc9b3cceaed525e7ecb9cf19780e0af5 (diff)
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: Evgeny Novikov <novikov@ispras.ru> Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/udc/net2272.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
index fbbe62513545..44d1ea2307bb 100644
--- a/drivers/usb/gadget/udc/net2272.c
+++ b/drivers/usb/gadget/udc/net2272.c
@@ -2370,6 +2370,8 @@ net2272_rdk1_probe(struct pci_dev *pdev, struct net2272 *dev)
err:
while (--i >= 0) {
+ if (i == 1)
+ continue; /* BAR1 unused */
iounmap(mem_mapped_addr[i]);
release_mem_region(pci_resource_start(pdev, i),
pci_resource_len(pdev, i));