On Sun, 13 Mar 2005, Ben Dooks wrote:

> This is an updated patch for the OHCI host controller
> on the Samsung S3C24xx series of CPUs. The patch is
> an re-work of the previous patch sent to the list,
> with some tidying, and updated to the 2.6.11-bk9
> kernel release.

> +     hcd = usb_create_hcd(driver, &dev->dev, "s3c24xx");
> +     if (hcd == NULL)
> +             return -ENOMEM;
> +
> +     hcd->rsrc_start = dev->resource[0].start;
> +     hcd->rsrc_len   = dev->resource[0].end - dev->resource[0].start + 1;
> +
> +     if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
> +             dev_err(&dev->dev, "request_mem_region failed");
> +             return -EBUSY;
> +     }

There's a memory leak here if request_mem_region fails.  You need to call 
usb_put_hcd.  Or rearrange the code so that hcd is allocated after the 
request_mem_region call.

Alan Stern



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to