Skip to content

Commit

Permalink
au1000_eth: possible NULL dereference of aup->mii_bus->irq in au1000_…
Browse files Browse the repository at this point in the history
…probe()

aup->mii_bus->irq allocation may fail, prevent a dereference of NULL.

Signed-off-by: Roel Kluin <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
RoelKluin authored and davem330 committed Sep 2, 2009
1 parent 5d78922 commit dcbfef8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/au1000_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,9 @@ static struct net_device * au1000_probe(int port_num)
aup->mii_bus->name = "au1000_eth_mii";
snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%x", aup->mac_id);
aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
if (aup->mii_bus->irq == NULL)
goto err_out;

for(i = 0; i < PHY_MAX_ADDR; ++i)
aup->mii_bus->irq[i] = PHY_POLL;

Expand Down

0 comments on commit dcbfef8

Please sign in to comment.