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:35:08 +0000 (12:35 +0200)
commit53a22fa7f9c20e77af9769e7f555c3fde6379704
treea4183bd3d82214215c8c9949df6a7913a2da2c7e
parent24da5765d1ede4c82362f47626f3fcb291a77fb5
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: a3138df9f20e ("[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