no checks are performed on the return from kmalloc, should check for valid pointer Cc: Ganesan Ramalingam <ganesanr@xxxxxxxxxxxx> Cc: Jayachandran Chandrashekaran Nair <jchandra@xxxxxxxxxxxx> Signed-off-by: Devendra Naga <devendra.aaru@xxxxxxxxx> --- drivers/staging/netlogic/xlr_net.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c index e348915..a228b9d 100644 --- a/drivers/staging/netlogic/xlr_net.c +++ b/drivers/staging/netlogic/xlr_net.c @@ -881,6 +881,11 @@ static int xlr_setup_mdio(struct xlr_net_priv *priv, priv->mii_bus->write = xlr_mii_write; priv->mii_bus->parent = &pdev->dev; priv->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); + if (!priv->mii_bus->irq) { + mdiobus_free(priv->mii_bus); + return -ENOMEM; + } + priv->mii_bus->irq[priv->phy_addr] = priv->ndev->irq; /* Scan only the enabled address */ -- 1.8.1.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel