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:	Tue, 24 Sep 2013 15:47:41 +0800
From:	Axel Lin <axel.lin@...ics.com>
To:	Linus Walleij <linus.walleij@...aro.org>
Cc:	Sonic Zhang <sonic.zhang@...log.com>, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] pinctrl: adi2: Fix dead lock in
 adi_gpio_direction_output

Current code hold port->lock spinlock and then try to grab the lock again
in adi_gpio_set_value(). Fix it.

Signed-off-by: Axel Lin <axel.lin@...ics.com>
---
 drivers/pinctrl/pinctrl-adi2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c
index f2aa877..8089fda 100644
--- a/drivers/pinctrl/pinctrl-adi2.c
+++ b/drivers/pinctrl/pinctrl-adi2.c
@@ -776,10 +776,11 @@ static int adi_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
 	struct gpio_port_t *regs = port->regs;
 	unsigned long flags;
 
+	adi_gpio_set_value(chip, offset, value);
+
 	spin_lock_irqsave(&port->lock, flags);
 
 	writew(readw(&regs->inen) & ~(1 << offset), &regs->inen);
-	adi_gpio_set_value(chip, offset, value);
 	writew(1 << offset, &regs->dir_set);
 
 	spin_unlock_irqrestore(&port->lock, flags);
-- 
1.8.1.2



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