lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 30 Jun 2014 11:08:21 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Himangi Saraogi <himangi774@...il.com>
cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<julia.lawall@...6.fr>
Subject: Re: [PATCH] usb: host: ohci-tmio: Use managed interfaces for resource
 allocation

On Sun, 29 Jun 2014, Himangi Saraogi wrote:

> This patch moves resources allocated using ioremap or
> dma_declare_coherent_memory to the corresponding managed interface. The
> function calls to free the allocated resources are removed in the probe
> and remove functions as they are no longer required. Also, some labels
> are done away with and a new label err added to make it less specific to
> the context.
> 
> Signed-off-by: Himangi Saraogi <himangi774@...il.com>
> Acked-by: Julia Lawall <julia.lawall@...6.fr>
> ---
>  drivers/usb/host/ohci-tmio.c | 36 ++++++++++++------------------------
>  1 file changed, 12 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
> index bb40958..1a6034f 100644
> --- a/drivers/usb/host/ohci-tmio.c
> +++ b/drivers/usb/host/ohci-tmio.c
> @@ -203,10 +203,8 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)
>  		return -EINVAL;
>  
>  	hcd = usb_create_hcd(&ohci_tmio_hc_driver, &dev->dev, dev_name(&dev->dev));
> -	if (!hcd) {
> -		ret = -ENOMEM;
> -		goto err_usb_create_hcd;
> -	}
> +	if (!hcd)
> +		return -ENOMEM;
>  
>  	hcd->rsrc_start = regs->start;
>  	hcd->rsrc_len = resource_size(regs);
> @@ -215,30 +213,31 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)
>  
>  	spin_lock_init(&tmio->lock);
>  
> -	tmio->ccr = ioremap(config->start, resource_size(config));
> +	tmio->ccr = devm_ioremap(&dev->dev, config->start,
> +				 resource_size(config));

You should use devm_ioremap_resource() rather than devm_ioremap().

...

> @@ -259,16 +258,8 @@ err_add_hcd:
>  	tmio_stop_hc(dev);
>  	if (cell->disable)
>  		cell->disable(dev);
> -err_enable:
> -	dma_release_declared_memory(&dev->dev);
> -err_dma_declare:
> -	iounmap(hcd->regs);
> -err_ioremap_regs:
> -	iounmap(tmio->ccr);
> -err_ioremap_ccr:
> -	usb_put_hcd(hcd);
> -err_usb_create_hcd:
> -
> +err:
> +	usb_put_hcr(hcd);

There is no function named "usb_put_hcr()".  Did you try to compile 
this patch?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ