Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1658600

[PATCH][net-next] net/mlxfw: remove redundant goto on error check

From Colin King <colin.king@canonical.com>
Newsgroups linux.kernel
Subject [PATCH][net-next] net/mlxfw: remove redundant goto on error check
Date 2017-06-06 12:50 +0200
Message-ID <tPkdH-7xX-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Colin Ian King <colin.king@canonical.com>

The check to see of err is set and the subsequent goto is extraneous
as the next statement is where the goto is jumping to. Remove this
redundant check and goto.

Detected by CoverityScan, CID#1437734 ("Identical code for
different branches")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c
index 7e9589061d30..628150d28061 100644
--- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c
+++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c
@@ -492,8 +492,6 @@ static int mlxfw_mfa2_file_cb_offset_xz(const struct mlxfw_mfa2_file *mfa2_file,
 	dec_buf.out_pos = 0;
 	dec_buf.out_size = size;
 	err = mlxfw_mfa2_xz_dec_run(xz_dec, &dec_buf, &finished);
-	if (err)
-		goto out;
 out:
 	xz_dec_end(xz_dec);
 	return err;
-- 
2.11.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH][net-next] net/mlxfw: remove redundant goto on error check Colin King <colin.king@canonical.com> - 2017-06-06 12:50 +0200
  Re: [PATCH][net-next] net/mlxfw: remove redundant goto on error  check David Miller <davem@davemloft.net> - 2017-06-06 18:30 +0200

csiph-web