Commit 17d95640 authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller

drivers/net: Eliminate a NULL pointer dereference

At the point of the print, dev is NULL.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E,E1;
identifier f;
statement S1,S2,S3;
@@

if ((E == NULL && ...) || ...)
{
  ... when != if (...) S1 else S2
      when != E = E1
* E->f
  ... when any
  return ...;
}
else S3
// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 89dc0be6
...@@ -551,8 +551,7 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id) ...@@ -551,8 +551,7 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id)
void __iomem *shmem; void __iomem *shmem;
if (dev == NULL) { if (dev == NULL) {
pr_err("%s: net_interrupt(): irq %d for unknown device.\n", pr_err("net_interrupt(): irq %d for unknown device.\n", irq);
dev->name, irq);
return IRQ_NONE; return IRQ_NONE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment