* [PATCH net-next] net: ethernet: mtk_eth_soc: add check for allocation failure
@ 2022-04-21 15:49 Dan Carpenter
2022-04-25 10:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-04-21 15:49 UTC (permalink / raw)
To: Felix Fietkau
Cc: John Crispin, Sean Wang, Mark Lee, David S. Miller,
Jakub Kicinski, Paolo Abeni, Matthias Brugger, netdev,
linux-mediatek, kernel-janitors
Check if the kzalloc() failed.
Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/net/ethernet/mediatek/mtk_wed.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index f0eacf819cd9..a2793bbb8ce0 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -827,6 +827,8 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
goto unlock;
hw = kzalloc(sizeof(*hw), GFP_KERNEL);
+ if (!hw)
+ goto unlock;
hw->node = np;
hw->regs = regs;
hw->eth = eth;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: ethernet: mtk_eth_soc: add check for allocation failure
2022-04-21 15:49 [PATCH net-next] net: ethernet: mtk_eth_soc: add check for allocation failure Dan Carpenter
@ 2022-04-25 10:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-25 10:30 UTC (permalink / raw)
To: Dan Carpenter
Cc: nbd, john, sean.wang, Mark-MC.Lee, davem, kuba, pabeni,
matthias.bgg, netdev, linux-mediatek, kernel-janitors
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Thu, 21 Apr 2022 18:49:02 +0300 you wrote:
> Check if the kzalloc() failed.
>
> Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/net/ethernet/mediatek/mtk_wed.c | 2 ++
> 1 file changed, 2 insertions(+)
Here is the summary with links:
- [net-next] net: ethernet: mtk_eth_soc: add check for allocation failure
https://git.kernel.org/netdev/net-next/c/a00e41bf2f47
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-25 10:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-21 15:49 [PATCH net-next] net: ethernet: mtk_eth_soc: add check for allocation failure Dan Carpenter
2022-04-25 10:30 ` patchwork-bot+netdevbpf
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).