diff options
author | Christophe Jaillet <christophe.jaillet@wanadoo.fr> | 2017-08-25 07:35:51 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-25 20:07:07 -0700 |
commit | 2207d182c14294d78b98142f0b6a16bea5e8b0fb (patch) | |
tree | 55a028206ea975a31536c86426cf344131cf4663 /drivers/net/ethernet/samsung | |
parent | 681e9e867ea06219d26f02ae4a93979734b9ad44 (diff) | |
download | linux-2207d182c14294d78b98142f0b6a16bea5e8b0fb.tar.bz2 |
net: sxgbe: check memory allocation failure
Check memory allocation failure and return -ENOMEM in such a case, as
already done few lines below for another memory allocation.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/samsung')
-rw-r--r-- | drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c index 73427e29df2a..fbd00cb0cb7d 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c @@ -47,6 +47,8 @@ static int sxgbe_probe_config_dt(struct platform_device *pdev, plat->mdio_bus_data = devm_kzalloc(&pdev->dev, sizeof(*plat->mdio_bus_data), GFP_KERNEL); + if (!plat->mdio_bus_data) + return -ENOMEM; dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), GFP_KERNEL); if (!dma_cfg) |