linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] pinctrl: baytrail: fix some error handling in debugfs
@ 2016-04-27  8:08 Dan Carpenter
  2016-04-28 10:55 ` Mika Westerberg
  2016-04-30 11:35 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-04-27  8:08 UTC (permalink / raw)
  To: Mika Westerberg, Cristina Ciocan
  Cc: Heikki Krogerus, Linus Walleij, linux-gpio, linux-kernel,
	kernel-janitors

We need to unlock before continuing.  Also the continue was accidentally
left out on one error path which would lead to a NULL dereference.

Fixes: 86e3ef812fe3 ('pinctrl: baytrail: Update gpio chip operations')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index 6dcf43a..55182fc 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -1390,6 +1390,7 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
 			seq_printf(s,
 				   "Could not retrieve pin %i conf0 reg\n",
 				   pin);
+			raw_spin_unlock_irqrestore(&vg->lock, flags);
 			continue;
 		}
 		conf0 = readl(reg);
@@ -1398,6 +1399,8 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
 		if (!reg) {
 			seq_printf(s,
 				   "Could not retrieve pin %i val reg\n", pin);
+			raw_spin_unlock_irqrestore(&vg->lock, flags);
+			continue;
 		}
 		val = readl(reg);
 		raw_spin_unlock_irqrestore(&vg->lock, flags);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] pinctrl: baytrail: fix some error handling in debugfs
  2016-04-27  8:08 [patch] pinctrl: baytrail: fix some error handling in debugfs Dan Carpenter
@ 2016-04-28 10:55 ` Mika Westerberg
  2016-04-30 11:35 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2016-04-28 10:55 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Cristina Ciocan, Heikki Krogerus, Linus Walleij, linux-gpio,
	linux-kernel, kernel-janitors

On Wed, Apr 27, 2016 at 11:08:35AM +0300, Dan Carpenter wrote:
> We need to unlock before continuing.  Also the continue was accidentally
> left out on one error path which would lead to a NULL dereference.
> 
> Fixes: 86e3ef812fe3 ('pinctrl: baytrail: Update gpio chip operations')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Good catch!

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] pinctrl: baytrail: fix some error handling in debugfs
  2016-04-27  8:08 [patch] pinctrl: baytrail: fix some error handling in debugfs Dan Carpenter
  2016-04-28 10:55 ` Mika Westerberg
@ 2016-04-30 11:35 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2016-04-30 11:35 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mika Westerberg, Cristina Ciocan, Heikki Krogerus, linux-gpio,
	linux-kernel, kernel-janitors

On Wed, Apr 27, 2016 at 10:08 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:

> We need to unlock before continuing.  Also the continue was accidentally
> left out on one error path which would lead to a NULL dereference.
>
> Fixes: 86e3ef812fe3 ('pinctrl: baytrail: Update gpio chip operations')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Patch applied with Mika's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-30 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-27  8:08 [patch] pinctrl: baytrail: fix some error handling in debugfs Dan Carpenter
2016-04-28 10:55 ` Mika Westerberg
2016-04-30 11:35 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).