Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751456AbdFFKro (ORCPT ); Tue, 6 Jun 2017 06:47:44 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:45011 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbdFFKrm (ORCPT ); Tue, 6 Jun 2017 06:47:42 -0400 From: Colin King To: Yotam Gigi , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][net-next] net/mlxfw: remove redundant goto on error check Date: Tue, 6 Jun 2017 11:47:40 +0100 Message-Id: <20170606104740.15712-1-colin.king@canonical.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 995 Lines: 29 From: Colin Ian King 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 --- 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