提交 2207d182 编写于 作者: C Christophe Jaillet 提交者: David S. Miller

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: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 681e9e86
...@@ -47,6 +47,8 @@ static int sxgbe_probe_config_dt(struct platform_device *pdev, ...@@ -47,6 +47,8 @@ static int sxgbe_probe_config_dt(struct platform_device *pdev,
plat->mdio_bus_data = devm_kzalloc(&pdev->dev, plat->mdio_bus_data = devm_kzalloc(&pdev->dev,
sizeof(*plat->mdio_bus_data), sizeof(*plat->mdio_bus_data),
GFP_KERNEL); GFP_KERNEL);
if (!plat->mdio_bus_data)
return -ENOMEM;
dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), GFP_KERNEL); dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), GFP_KERNEL);
if (!dma_cfg) if (!dma_cfg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册