summaryrefslogtreecommitdiff
path: root/drivers/staging/netlogic
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2014-02-05 11:56:43 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-07 11:10:08 -0800
commitad3815a595fd7a5c5e4a24947a56eec29582a505 (patch)
tree256aa821794f80052491eb04a0753a9283fea843 /drivers/staging/netlogic
parente6ff3f4e6d258021fe041d7acf5d013c26bf387b (diff)
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.c5
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 */