Skip to content

Commit 8ce07be

Browse files
harshimogalapallidavem330
authored andcommitted
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: a3138df ("[NIU]: Add Sun Neptune ethernet driver.") Signed-off-by: Harshit Mogalapalli <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f2afccf commit 8ce07be

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/sun

1 file changed

+1
-1
lines changed

drivers/net/ethernet/sun/niu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4522,7 +4522,7 @@ static int niu_alloc_channels(struct niu *np)
45224522

45234523
err = niu_rbr_fill(np, rp, GFP_KERNEL);
45244524
if (err)
4525-
return err;
4525+
goto out_err;
45264526
}
45274527

45284528
tx_rings = kcalloc(num_tx_rings, sizeof(struct tx_ring_info),

0 commit comments

Comments
 (0)