]> git.dujemihanovic.xyz Git - linux.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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Apr 2023 07:17:54 +0000 (08:17 +0100)
commit8ce07be703456acb00e83d99f3b8036252c33b02
tree48e980e01004b757428635cd325cdd826e3daab2
parentf2afccfefe7be1f7346564fe619277110d341f9b
niu: Fix missing unwind goto in niu_alloc_channels()

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>
drivers/net/ethernet/sun/niu.c