diff options
author | Alan Cox <alan@linux.intel.com> | 2014-02-05 15:56:43 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 23:10:08 +0400 |
commit | ad3815a595fd7a5c5e4a24947a56eec29582a505 (patch) | |
tree | 256aa821794f80052491eb04a0753a9283fea843 /drivers/staging/netlogic | |
parent | e6ff3f4e6d258021fe041d7acf5d013c26bf387b (diff) | |
download | linux-ad3815a595fd7a5c5e4a24947a56eec29582a505.tar.xz |
xlr_net: Fix missing trivial allocation check
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/netlogic')
-rw-r--r-- | drivers/staging/netlogic/xlr_net.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c index eedffed17e39..d8ea25486a33 100644 --- a/drivers/staging/netlogic/xlr_net.c +++ b/drivers/staging/netlogic/xlr_net.c @@ -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 */ |