usb: gadget: s3c-hsudc: use release_mem_region instead of release_resource
authorHeiko Stübner <heiko@sntech.de>
Mon, 19 Dec 2011 18:42:52 +0000 (19:42 +0100)
committerFelipe Balbi <balbi@ti.com>
Wed, 21 Dec 2011 11:24:41 +0000 (13:24 +0200)
As the memory region is requested through request_mem_region
use the correct paired method to release it in the error path
and don't go "beneath the API".

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/s3c-hsudc.c

index 94f48f66f59048ffc5f83fd140e618c7d0382055..f9de57e15a182b5a36e32850702464ded6632292 100644 (file)
@@ -1376,9 +1376,7 @@ err_irq:
        iounmap(hsudc->regs);
 
 err_remap:
-       release_resource(hsudc->mem_rsrc);
-       kfree(hsudc->mem_rsrc);
-
+       release_mem_region(res->start, resource_size(res));
 err_res:
        if (hsudc->transceiver)
                otg_put_transceiver(hsudc->transceiver);