Skip to content

Commit

Permalink
usb: gadget: mv_udc_core: fix phy_regs I/O memory leak
Browse files Browse the repository at this point in the history
There was an omission in transition to devm_xxx resource handling.
iounmap(udc->phy_regs) were removed, but ioremap() was left
without devm_.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: 3517c31 ("usb: gadget: mv_udc: use devm_xxx for probe")
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Alexey Khoroshilov authored and Felipe Balbi committed Jul 20, 2015
1 parent 4696b88 commit 53e20f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/udc/mv_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@ static int mv_udc_probe(struct platform_device *pdev)
return -ENODEV;
}

udc->phy_regs = ioremap(r->start, resource_size(r));
udc->phy_regs = devm_ioremap(&pdev->dev, r->start, resource_size(r));
if (udc->phy_regs == NULL) {
dev_err(&pdev->dev, "failed to map phy I/O memory\n");
return -EBUSY;
Expand Down

0 comments on commit 53e20f2

Please sign in to comment.