mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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>
This commit is contained in:
parent
5d7892298a
commit
dcbfef820b
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue