Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1701473rdb; Sat, 20 Jan 2024 09:25:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUFgxDdB+ekaJr9OW5p5Fp9gakxsyzx2e36+lhpJ3WtA7N2amuY05XKaIvpvD62JXGo1oh X-Received: by 2002:a50:d553:0:b0:55a:5b18:ada6 with SMTP id f19-20020a50d553000000b0055a5b18ada6mr454569edj.98.1705771559013; Sat, 20 Jan 2024 09:25:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705771559; cv=pass; d=google.com; s=arc-20160816; b=kbaTlbrHWfnxEdUfEsApAlCZH/9nRCA/zV4FicXxMk9+StE/i6T7yrPg2rfhopf9Y2 UNfG9rNHDuWUMvUzwin5KeHTM9Fn3RRBYs3W/qfD6CI3Op+0kkyfmqO2iPXgCmEMkG3m y4ceWLrSOScO9z2I2VjJs79SC+8a7Z1sbmUWfCAWkw3UYiWKtEUZFscFHv3p0ziQs+Gc finv4gdiA9YnIB9MKAAk4ml/V02zFR6su8HhT26RJknA0yanBHsaQhLBCycFucpt2UAA kbPIz2cSbdxhRYNnZeyQqgRZcLie9Am7i34+shCvpM/InkCDs5w5p/716Sbas4u8lQbu duRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=wFri96r10IYTNO8+N94yIYZtcJHCQ7p90QlQKgXP2zQ=; fh=mbhMb9Y5YOyzaE/YePPBg+RrKUA/B4eUiKLwQxtL51g=; b=y02Us19udExjw38GqwY/bycCVEGeq4NNkKzCjnWbbi/l8t24iRX7qF4pWDzuZGAJ0M U+TuYnqHKjpDEHT0GA5WmN9hRUkDy78PS/KL83ddygoKHXQwqDwi5GTgWPT7uw09a/jO zGnr0QIxbq59XaT1vDobXT/iFd1YJu8lTpSvxGfrROjkbsezEgxNAmTLs+I7W8yC6MUx 2R2BGjnUffByTDPPqpuclhcuZRk2ksMJjJuZJEqZBVGh2dXTziEUm0qqPXbb9TqcYcRC ebvtJx5jZc0oLKKOmy1jP/+SUU4oQMWFDIT1r9LFjC6RG260heI0qisktRf+QO1ROW05 4DEQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=m47oR2wF; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-31854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31854-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i34-20020a0564020f2200b0055bff9ade42si422972eda.170.2024.01.20.09.25.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 09:25:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=m47oR2wF; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-31854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31854-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B99FA1F21D96 for ; Sat, 20 Jan 2024 17:25:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0718511733; Sat, 20 Jan 2024 17:25:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="m47oR2wF" Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5DD310A14 for ; Sat, 20 Jan 2024 17:25:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705771554; cv=none; b=hB66luRvXsYcjWOqIn+Mnhjh2cIJ8fMjlwu75XkSydZKdEmx/KwLlFmjyVplGHlzd7Z6ltiDcvhKno9qRsPPzA/KINabse/EBW6aHU7CqeKVtRKuVezRj368zW5HrPPM6oNRbfuAt7Q6X2CWdf44bDLorYU2uj3I0NNxUfbp9cY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705771554; c=relaxed/simple; bh=IHy3yKUWKTLuOD8hN3UJHVbeSR7P1m1XoNYyPhd0+ec=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Td8mpSYWH6GlNhDM96xIDlDmobFK/vMuRcUDg7uE8qq0YsNijpx6zMh6UJ4rxnDQOngKtCxocrw4jg0vWnTdCKJwoWkJUGizZLAvHmQRNgoPRAeN+Y+DzzxKQI1S08LGk2+i7tMDTaOO+qqvtLkwgyBm1JcPb3u0R0LZ7gsi/7A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=m47oR2wF; arc=none smtp.client-ip=80.12.242.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id RF6DrefClXxngRF6DrrUj2; Sat, 20 Jan 2024 18:25:44 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1705771544; bh=wFri96r10IYTNO8+N94yIYZtcJHCQ7p90QlQKgXP2zQ=; h=From:To:Cc:Subject:Date; b=m47oR2wFqaPhS795diQSgtuX4Cry1l/u1GV8fdwbAzJKCPH2sO5yOU2uBSFK/sZw0 WtqVMmILCibiJMHFb9G1XAXukYgkby0Qz0a2znFeu77RdNH3Vg2lRqIMr5q+pQNDsh 4ZND9BAePxKXF0TK+RQMZwpst4WWC6lgIaSiGlBfJ0uph6p0iEcnI1jWy5CJUASCZA weMAHL4HFdfiy0tx9tJfjxAn+BwcZMSrwciEamrwCBgxJu+mRLbgBGNXXhzRzUqDS0 FA+9pgNY9P8agJN9FOXVj4HcfcTcM+9hWujZkh6+00HqAIe1b320aV91k6xiDgQ+xu wx8zSB/kq4eQw== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 20 Jan 2024 18:25:44 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jeff Kirsher , Mark Rustad Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: [PATCH] ixgbe: Fix an error handling path in ixgbe_read_iosf_sb_reg_x550() Date: Sat, 20 Jan 2024 18:25:36 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit All error handling paths, except this one, go to 'out' where release_swfw_sync() is called. This call balances the acquire_swfw_sync() call done at the beginning of the function. Branch to the error handling path in order to correctly release some resources in case of error. Fixes: ae14a1d8e104 ("ixgbe: Fix IOSF SB access issues") Signed-off-by: Christophe JAILLET --- This patch is speculative, review with care. --- drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c index 6208923e29a2..c1adc94a5a65 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c @@ -716,7 +716,8 @@ static s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, if ((command & IXGBE_SB_IOSF_CTRL_RESP_STAT_MASK) != 0) { error = FIELD_GET(IXGBE_SB_IOSF_CTRL_CMPL_ERR_MASK, command); hw_dbg(hw, "Failed to read, error %x\n", error); - return -EIO; + ret = -EIO; + goto out; } if (!ret) -- 2.43.0