1 From: Dan Carpenter <dan.carpenter@oracle.com>
2 Date: Thu, 21 Apr 2022 18:49:02 +0300
3 Subject: [PATCH] net: ethernet: mtk_eth_soc: add check for allocation failure
5 Check if the kzalloc() failed.
7 Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
8 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
9 Signed-off-by: David S. Miller <davem@davemloft.net>
12 --- a/drivers/net/ethernet/mediatek/mtk_wed.c
13 +++ b/drivers/net/ethernet/mediatek/mtk_wed.c
14 @@ -827,6 +827,8 @@ void mtk_wed_add_hw(struct device_node *
17 hw = kzalloc(sizeof(*hw), GFP_KERNEL);