Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754876AbdGCNgl (ORCPT ); Mon, 3 Jul 2017 09:36:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34256 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754835AbdGCNgf (ORCPT ); Mon, 3 Jul 2017 09:36:35 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Anholt , Florian Fainelli , Guenter Roeck , Wim Van Sebroeck Subject: [PATCH 3.18 30/36] watchdog: bcm281xx: Fix use of uninitialized spinlock. Date: Mon, 3 Jul 2017 15:34:27 +0200 Message-Id: <20170703133257.484070264@linuxfoundation.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170703133256.260692013@linuxfoundation.org> References: <20170703133256.260692013@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1331 Lines: 44 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Anholt commit fedf266f9955d9a019643cde199a2fd9a0259f6f upstream. The bcm_kona_wdt_set_resolution_reg() call takes the spinlock, so initialize it earlier. Fixes a warning at boot with lock debugging enabled. Fixes: 6adb730dc208 ("watchdog: bcm281xx: Watchdog Driver") Signed-off-by: Eric Anholt Reviewed-by: Florian Fainelli Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/bcm_kona_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/watchdog/bcm_kona_wdt.c +++ b/drivers/watchdog/bcm_kona_wdt.c @@ -299,6 +299,8 @@ static int bcm_kona_wdt_probe(struct pla 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)) @@ -311,7 +313,6 @@ static int bcm_kona_wdt_probe(struct pla return ret; } - spin_lock_init(&wdt->lock); platform_set_drvdata(pdev, wdt); watchdog_set_drvdata(&bcm_kona_wdt_wdd, wdt);