netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: sxgbe: check memory allocation failure
@ 2017-08-25  5:35 Christophe JAILLET
  2017-08-26  3:07 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2017-08-25  5:35 UTC (permalink / raw)
  To: bh74.an, ks.giri, vipul.pandya
  Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET

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>
---
 drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | 2 ++
 1 file changed, 2 insertions(+)

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)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: sxgbe: check memory allocation failure
  2017-08-25  5:35 [PATCH] net: sxgbe: check memory allocation failure Christophe JAILLET
@ 2017-08-26  3:07 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-08-26  3:07 UTC (permalink / raw)
  To: christophe.jaillet
  Cc: bh74.an, ks.giri, vipul.pandya, netdev, linux-kernel,
	kernel-janitors

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Fri, 25 Aug 2017 07:35:51 +0200

> 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>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-26  3:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-25  5:35 [PATCH] net: sxgbe: check memory allocation failure Christophe JAILLET
2017-08-26  3:07 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).