]> git.baikalelectronics.ru Git - kernel.git/commit
niu: Fix missing unwind goto in niu_alloc_channels()
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Thu, 6 Apr 2023 06:31:18 +0000 (23:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Apr 2023 10:07:36 +0000 (12:07 +0200)
commitb12c7431b267d7b41af03f477f1b3a00aa664416
treee9d4e1453c33cadad392347f8d1cec584cf7683f
parent174e6b9fe6aa2480573f8424e53005b7cd896a3d
niu: Fix missing unwind goto in niu_alloc_channels()

[ Upstream commit 8ce07be703456acb00e83d99f3b8036252c33b02 ]

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: efc13071a69a ("[NIU]: Add Sun Neptune ethernet driver.")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/sun/niu.c