mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
net: ethernet: mtk_eth_soc: add check for allocation failure
Check if the kzalloc() failed.
Fixes: 804775dfc2
("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
60d78e9fce
commit
a00e41bf2f
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue