netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][net-next] net/mlxfw: remove redundant goto on error check
@ 2017-06-06 10:47 Colin King
  2017-06-06 10:53 ` Yotam Gigi
  2017-06-06 16:22 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2017-06-06 10:47 UTC (permalink / raw)
  To: Yotam Gigi, netdev; +Cc: kernel-janitors, linux-kernel

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][net-next] net/mlxfw: remove redundant goto on error check
  2017-06-06 10:47 [PATCH][net-next] net/mlxfw: remove redundant goto on error check Colin King
@ 2017-06-06 10:53 ` Yotam Gigi
  2017-06-06 16:22 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Yotam Gigi @ 2017-06-06 10:53 UTC (permalink / raw)
  To: Colin King, netdev; +Cc: kernel-janitors, linux-kernel

On 06/06/2017 01:47 PM, Colin King wrote:
> 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;


Thanks!

Acked-by: Yotam Gigi <yotamg@mellanox.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][net-next] net/mlxfw: remove redundant goto on error check
  2017-06-06 10:47 [PATCH][net-next] net/mlxfw: remove redundant goto on error check Colin King
  2017-06-06 10:53 ` Yotam Gigi
@ 2017-06-06 16:22 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-06-06 16:22 UTC (permalink / raw)
  To: colin.king; +Cc: yotamg, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Tue,  6 Jun 2017 11:47:40 +0100

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-06 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-06 10:47 [PATCH][net-next] net/mlxfw: remove redundant goto on error check Colin King
2017-06-06 10:53 ` Yotam Gigi
2017-06-06 16:22 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).