Skip to content

Commit

Permalink
mfd: ab8500-debugfs: Move dereference after check for NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Lee Jones committed Jan 6, 2014
1 parent d6e0a2d commit 7c0b238
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/mfd/ab8500-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,15 +1600,16 @@ 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],
num_wake_interrupts[line]);

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);
Expand Down

0 comments on commit 7c0b238

Please sign in to comment.