Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a841f6a0 authored by Harshit Mogalapalli's avatar Harshit Mogalapalli Committed by Greg Kroah-Hartman
Browse files

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: a3138df9 ("[NIU]: Add Sun Neptune ethernet driver.")
Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent fcd084e1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4503,7 +4503,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),