summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/samsung
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2017-08-25 07:35:51 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-26 05:07:07 +0200
commit2207d182c14294d78b98142f0b6a16bea5e8b0fb (patch)
tree55a028206ea975a31536c86426cf344131cf4663 /drivers/net/ethernet/samsung
parentMerge branch 'r8169-Be-drop-monitor-friendly' (diff)
downloadlinux-2207d182c14294d78b98142f0b6a16bea5e8b0fb.tar.xz
linux-2207d182c14294d78b98142f0b6a16bea5e8b0fb.zip
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.c2
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)