[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250206175114.1974171-16-bvanassche@acm.org>
Date: Thu, 6 Feb 2025 09:50:56 -0800
From: Bart Van Assche <bvanassche@....org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Will Deacon <will@...nel.org>,
Christoph Hellwig <hch@....de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Marco Elver <elver@...gle.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nathan Chancellor <nathan@...nel.org>,
Kees Cook <kees@...nel.org>,
Jann Horn <jannh@...gle.com>,
linux-kernel@...r.kernel.org,
Bart Van Assche <bvanassche@....org>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>
Subject: [PATCH RFC 15/33] ice: Fix a locking bug in an error path
Do not unlock pf->tc_mutex if it has not been locked. Jumping to
'dcb_error' causes pf->tc_mutex to be unlocked. This bug has been detected
by the Clang thread-safety analyzer.
Cc: Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Fixes: 242b5e068b25 ("ice: Fix DCB rebuild after reset")
Signed-off-by: Bart Van Assche <bvanassche@....org>
---
drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
index 69a4b84f935f..65545613e1e8 100644
--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
@@ -563,7 +563,8 @@ void ice_dcb_rebuild(struct ice_pf *pf)
ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);
if (ret) {
dev_err(dev, "Query Port ETS failed\n");
- goto dcb_error;
+ disable_dcb(pf);
+ return;
}
mutex_lock(&pf->tc_mutex);
Powered by blists - more mailing lists