* [patch] mfd: ab8500-debugfs: move dereference after check for NULL
@ 2013-11-13 7:40 Dan Carpenter
2013-11-19 8:07 ` Linus Walleij
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2013-11-13 7:40 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
I am not able to compile this.
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index e33e385..d1a22aa 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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [patch] mfd: ab8500-debugfs: move dereference after check for NULL
2013-11-13 7:40 [patch] mfd: ab8500-debugfs: move dereference after check for NULL Dan Carpenter
@ 2013-11-19 8:07 ` Linus Walleij
2013-11-19 8:24 ` Lee Jones
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2013-11-19 8:07 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 13, 2013 at 8:40 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>
> ---
> I am not able to compile this.
Looks and compiles good.
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Lee are you queueing this?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch] mfd: ab8500-debugfs: move dereference after check for NULL
2013-11-19 8:07 ` Linus Walleij
@ 2013-11-19 8:24 ` Lee Jones
0 siblings, 0 replies; 3+ messages in thread
From: Lee Jones @ 2013-11-19 8:24 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 19 Nov 2013, Linus Walleij wrote:
> On Wed, Nov 13, 2013 at 8:40 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> > 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>
> > ---
> > I am not able to compile this.
>
> Looks and compiles good.
> Tested-by: Linus Walleij <linus.walleij@linaro.org>
>
> Lee are you queueing this?
This one slipped through the net, thanks for bringing it to my attention.
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-19 8:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13 7:40 [patch] mfd: ab8500-debugfs: move dereference after check for NULL Dan Carpenter
2013-11-19 8:07 ` Linus Walleij
2013-11-19 8:24 ` Lee Jones
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).