Commit 1bd8a666 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Luis Henriques

usb: gadget: mv_udc_core: fix phy_regs I/O memory leak

commit 53e20f2e upstream.

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: 3517c31a ("usb: gadget: mv_udc: use devm_xxx for probe")
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
[ luis: backported to 3.16:
  - file rename: drivers/usb/gadget/udc/mv_udc_core.c ->
    drivers/usb/gadget/mv_udc_core.c ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 39b01edc
...@@ -2160,7 +2160,7 @@ static int mv_udc_probe(struct platform_device *pdev) ...@@ -2160,7 +2160,7 @@ static int mv_udc_probe(struct platform_device *pdev)
return -ENODEV; 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) { if (udc->phy_regs == NULL) {
dev_err(&pdev->dev, "failed to map phy I/O memory\n"); dev_err(&pdev->dev, "failed to map phy I/O memory\n");
return -EBUSY; return -EBUSY;
......
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