Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1632477

Re: [PATCH] watchdog: bcm281xx: Fix use of uninitialized spinlock.

From Florian Fainelli <f.fainelli@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] watchdog: bcm281xx: Fix use of uninitialized spinlock.
Date 2017-04-28 03:30 +0200
Message-ID <tB2Tn-wX-9@gated-at.bofh.it> (permalink)
References <tB2A1-nM-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 04/27/2017 06:02 PM, Eric Anholt wrote:
> The bcm_kona_wdt_set_resolution_reg() call takes the spinlock, so
> initialize it earlier.  Fixes a warning at boot with lock debugging
> enabled.
> 
> Signed-off-by: Eric Anholt <eric@anholt.net>

Fixes: 6adb730dc208 ("watchdog: bcm281xx: Watchdog Driver")
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  drivers/watchdog/bcm_kona_wdt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c
> index 6fce17d5b9f1..a5775dfd8d5f 100644
> --- a/drivers/watchdog/bcm_kona_wdt.c
> +++ b/drivers/watchdog/bcm_kona_wdt.c
> @@ -304,6 +304,8 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
>  	if (!wdt)
>  		return -ENOMEM;
>  
> +	spin_lock_init(&wdt->lock);
> +
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	wdt->base = devm_ioremap_resource(dev, res);
>  	if (IS_ERR(wdt->base))
> @@ -316,7 +318,6 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	spin_lock_init(&wdt->lock);
>  	platform_set_drvdata(pdev, wdt);
>  	watchdog_set_drvdata(&bcm_kona_wdt_wdd, wdt);
>  	bcm_kona_wdt_wdd.parent = &pdev->dev;
> 

-- 
Florian

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] watchdog: bcm281xx: Fix use of uninitialized spinlock. Eric Anholt <eric@anholt.net> - 2017-04-28 03:10 +0200
  Re: [PATCH] watchdog: bcm281xx: Fix use of uninitialized spinlock. Florian Fainelli <f.fainelli@gmail.com> - 2017-04-28 03:30 +0200
  Re: [PATCH] watchdog: bcm281xx: Fix use of uninitialized spinlock. Guenter Roeck <linux@roeck-us.net> - 2017-04-28 04:30 +0200

csiph-web