Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad3815a5 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman
Browse files

xlr_net: Fix missing trivial allocation check

parent e6ff3f4e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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 */