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


Groups > linux.kernel > #1388768 > unrolled thread

[patch] pinctrl: baytrail: fix some error handling in debugfs

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-04-27 10:10 +0200
Last post2016-04-27 10:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [patch] pinctrl: baytrail: fix some error handling in debugfs Dan Carpenter <dan.carpenter@oracle.com> - 2016-04-27 10:10 +0200

#1388768 — [patch] pinctrl: baytrail: fix some error handling in debugfs

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-04-27 10:10 +0200
Subject[patch] pinctrl: baytrail: fix some error handling in debugfs
Message-ID<rssHM-6hy-21@gated-at.bofh.it>
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);

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web