summaryrefslogtreecommitdiff
path: root/drivers/mfd/ab8500-debugfs.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-11-13 10:40:30 +0300
committerLee Jones <lee.jones@linaro.org>2014-01-06 09:13:17 +0000
commit7c0b2380da953d8f63618f530af18eff3518d259 (patch)
tree20165e81dba408739f684155befe4d9f8aac4c7c /drivers/mfd/ab8500-debugfs.c
parentd6e0a2dd12f4067a5bcefb8bbd8ddbeff800afbc (diff)
mfd: ab8500-debugfs: Move dereference after check for NULL
We dereference "desc" before check if it is NULL. I've shifted it around so we check first before dereferencing. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/ab8500-debugfs.c')
-rw-r--r--drivers/mfd/ab8500-debugfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index e33e385af0a2..d1a22aae2df5 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -1600,7 +1600,6 @@ static int ab8500_interrupts_print(struct seq_file *s, void *p)
for (line = 0; line < num_interrupt_lines; line++) {
struct irq_desc *desc = irq_to_desc(line + irq_first);
- struct irqaction *action = desc->action;
seq_printf(s, "%3i: %6i %4i", line,
num_interrupts[line],
@@ -1608,7 +1607,9 @@ static int ab8500_interrupts_print(struct seq_file *s, void *p)
if (desc && desc->name)
seq_printf(s, "-%-8s", desc->name);
- if (action) {
+ if (desc && desc->action) {
+ struct irqaction *action = desc->action;
+
seq_printf(s, " %s", action->name);
while ((action = action->next) != NULL)
seq_printf(s, ", %s", action->name);