From: roel kluin Date: Sun, 30 Aug 2009 22:40:15 +0000 (+0000) Subject: au1000_eth: possible NULL dereference of aup->mii_bus->irq in au1000_probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dcbfef820bdd1cdb412ccf234840e23edf67014f;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Acked-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 407fd45f56a1..fdf5937233fc 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c @@ -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;