net: ethernet: mtk_eth_soc: add check for allocation failure
Subsystems (5)
PATCH 1/1 net: ethernet: mtk_eth_soc: add check for allocation failure
Check if the kzalloc() failed.
Fixes 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/net/ethernet/mediatek/mtk_wed.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/mediatek/mtk_wed.c +2 -0
@@ -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;
Signature · 7 lines
2.20.1 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 7 lines · 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 <[email protected]>--- 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!
Signature · 9 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek