Skip to content

Commit

Permalink
xlr_net: Fix missing trivial allocation check
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Feb 7, 2014
1 parent e6ff3f4 commit ad3815a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/staging/netlogic/xlr_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,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 == NULL) {
pr_err("irq alloc failed\n");
mdiobus_free(priv->mii_bus);
return -ENOMEM;
}
priv->mii_bus->irq[priv->phy_addr] = priv->ndev->irq;

/* Scan only the enabled address */
Expand Down

0 comments on commit ad3815a

Please sign in to comment.