mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
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>
This commit is contained in:
parent
e6ff3f4e6d
commit
ad3815a595
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user