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  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:	Thu, 22 May 2014 18:48:45 +0000
From:	Paul Zimmerman <Paul.Zimmerman@...opsys.com>
To:	Jean-Jacques Hiblot <jjhiblot@...phandler.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
Subject: RE: [PATCH] DWC2: intializes the spin_lock earlier in the probe

> From: Jean-Jacques Hiblot [mailto:jjhiblot@...phandler.com]
> Sent: Thursday, May 22, 2014 5:10 AM
> 
> The spinlock hsotg->lock is intialized at the end of the probe. However it
> may be used from within dwc2_hcd_init(). This patch moves the
> initialization before the call to dwc2_hcd_init(). This make the locking
> correctness validator happy.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@...phandler.com>
> ---
>  drivers/usb/dwc2/platform.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index 37a8ab0..55fb30d 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -156,6 +156,8 @@ static int dwc2_driver_probe(struct platform_device *dev)
>  		params.dma_desc_enable = prop;
>  	}
> 
> +	spin_lock_init(&hsotg->lock);
> +
>  	if (IS_ENABLED(CONFIG_USB_DWC2_HOST)) {
>  		retval = dwc2_hcd_init(hsotg, irq, &params);
>  		if (retval)
> @@ -175,7 +177,6 @@ static int dwc2_driver_probe(struct platform_device *dev)
>  		if (retval)
>  			return retval;
>  	}
> -	spin_lock_init(&hsotg->lock);
> 
>  	platform_set_drvdata(dev, hsotg);
>  	return retval;
> --

Hmm. What tree is this against? platform.c in both Linus' tree and in
Greg's usb-next tree does not have a call to spin_lock_init().

-- 
Paul

--
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