mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-25 03:46:17 +00:00
niu: Fix missing unwind goto in niu_alloc_channels()
[ Upstream commit8ce07be703
] 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:a3138df9f2
("[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>
This commit is contained in:
parent
24da5765d1
commit
53a22fa7f9
1 changed files with 1 additions and 1 deletions
|
@ -4522,7 +4522,7 @@ static int niu_alloc_channels(struct niu *np)
|
|||
|
||||
err = niu_rbr_fill(np, rp, GFP_KERNEL);
|
||||
if (err)
|
||||
return err;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
tx_rings = kcalloc(num_tx_rings, sizeof(struct tx_ring_info),
|
||||
|
|
Loading…
Reference in a new issue