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]
Message-Id: <1272663589-4950-2-git-send-email-corbet@lwn.net>
Date:	Fri, 30 Apr 2010 15:39:47 -0600
From:	Jonathan Corbet <corbet@....net>
To:	linux-kernel@...r.kernel.org
Cc:	Harald Welte <laforge@...monks.org>, linux-fbdev@...r.kernel.org,
	JosephChan@....com.tw, ScottFang@...tech.com.cn,
	Bruno Prémont <bonbons@...ux-vserver.org>,
	Florian Tobias Schandinat <FlorianSchandinat@....de>
Subject: [PATCH 1/3] viafb: Do not remove gpiochip under spinlock

gpiochip_remove() is not meant to be called with interrupts disabled, and
there is no need for the lock here in any case.

Reported-by: Bruno Prémont <bonbons@...ux-vserver.org>
Signed-off-by: Jonathan Corbet <corbet@....net>
---
 drivers/video/via/via-gpio.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/via/via-gpio.c b/drivers/video/via/via-gpio.c
index 44537be..63cb7ac 100644
--- a/drivers/video/via/via-gpio.c
+++ b/drivers/video/via/via-gpio.c
@@ -246,7 +246,6 @@ static int viafb_gpio_remove(struct platform_device *platdev)
 	unsigned long flags;
 	int ret = 0, i;
 
-	spin_lock_irqsave(&gpio_config.vdev->reg_lock, flags);
 	/*
 	 * Get unregistered.
 	 */
@@ -254,16 +253,16 @@ static int viafb_gpio_remove(struct platform_device *platdev)
 		ret = gpiochip_remove(&gpio_config.gpio_chip);
 		if (ret) { /* Somebody still using it? */
 			printk(KERN_ERR "Viafb: GPIO remove failed\n");
-			goto out;
+			return ret;
 		}
 	}
 	/*
 	 * Disable the ports.
 	 */
+	spin_lock_irqsave(&gpio_config.vdev->reg_lock, flags);
 	for (i = 0; i < gpio_config.gpio_chip.ngpio; i += 2)
 		viafb_gpio_disable(gpio_config.active_gpios[i]);
 	gpio_config.gpio_chip.ngpio = 0;
-out:
 	spin_unlock_irqrestore(&gpio_config.vdev->reg_lock, flags);
 	return ret;
 }
-- 
1.7.0.1

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