Commit 9ec309b8 authored by Harshit Mogalapalli's avatar Harshit Mogalapalli Committed by sanglipeng
Browse files

niu: Fix missing unwind goto in niu_alloc_channels()

stable inclusion
from stable-v5.10.178
commit 8a1fdb35459d5738cd362c8bb33c2ba743c29c17
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8D927

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8a1fdb35459d5738cd362c8bb33c2ba743c29c17



--------------------------------

[ Upstream commit 8ce07be7 ]

Smatch reports: drivers/net/ethernet/sun/niu.c:4525
	niu_alloc_channels() warn: missing unwind goto?

If niu_rbr_fill() fails, then we are directly returning 'err' without
freeing the channels.

Fix this by changing direct return to a goto 'out_err'.

Fixes: a3138df9 ("[NIU]: Add Sun Neptune ethernet driver.")
Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 062f3384
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment