Skip to content

Commit dcbfef8

Browse files
RoelKluindavem330
authored andcommitted
au1000_eth: possible NULL dereference of aup->mii_bus->irq in au1000_probe()
aup->mii_bus->irq allocation may fail, prevent a dereference of NULL. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5d78922 commit dcbfef8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/au1000_eth.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,9 @@ static struct net_device * au1000_probe(int port_num)
11571157
aup->mii_bus->name = "au1000_eth_mii";
11581158
snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%x", aup->mac_id);
11591159
aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
1160+
if (aup->mii_bus->irq == NULL)
1161+
goto err_out;
1162+
11601163
for(i = 0; i < PHY_MAX_ADDR; ++i)
11611164
aup->mii_bus->irq[i] = PHY_POLL;
11621165

0 commit comments

Comments
 (0)