From patchwork Tue Dec 5 23:44:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13480875 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="GhkdEygR" Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F4015122 for ; Tue, 5 Dec 2023 15:44:30 -0800 (PST) Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-77dc38b4e8dso389575085a.1 for ; Tue, 05 Dec 2023 15:44:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1701819870; x=1702424670; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=BVUP3329gDTZt2+fwubl676AsKn766XC9PIt3X96WHY=; b=GhkdEygRp9IbaXE/qK1lOrsJM9VHFYILWYnnB5lSLjwbn5y/IFH5bDy5GfTcsGJjgf qTLWnUOBDi4aWlRNIWr00U0UJd5fGA+kSguiAD6QvPH9ID0PjUAW7Bld5nnu1XTCVimb tLo6EsNdDA2tVPs0XYnVrk6PF5+YFUdaDlnV8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701819870; x=1702424670; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BVUP3329gDTZt2+fwubl676AsKn766XC9PIt3X96WHY=; b=VIRZicypSHfg504Oe5R4spwKvfS9iWAg34Pcj1z3S7Ct3ICHKl0DBPpBWJqcwN8Sce k4mUArfl4uMBAqxnqvvZ+cI9/ZhYJt96ZpACyDtIgNzPs58Dq7KP7suABz/GT/a7+v6H gJgiaKskt73vzs0eeGlL2LPgPJ2+MGzGrm1TA/51N6BlsQsh8NtWslNlejTT8x0jbziZ VGJ0Qtrfac8769eMqPW0QsB3CKgo0hXYsplEiGld97ypFl13DB6tS3SHul9sR+OfgflG vfAVaqe+LdBbOcglyc0BAKS8ykdaycvgquqosJLM0+ZfHUWdmljXP7U83++V3A5C0pAo JEJg== X-Gm-Message-State: AOJu0Yy2Hn95NbRbtYRg8NI4MM+xOGSNqMv4IO9WpYwQjSrvHQ/7vNam 9MBr0kWuRth+XQKEfhrjjzsQmdLcQA3L8mxeR8U= X-Google-Smtp-Source: AGHT+IHTC42IcgQQZgQbi0I0XjsvZ+aeGjtc6bj5lgymEF9L8LuyguDT2uZeVAdIDoQbtQy4kCXNOA== X-Received: by 2002:a05:620a:120a:b0:77d:99a2:7450 with SMTP id u10-20020a05620a120a00b0077d99a27450mr65578qkj.28.1701819869848; Tue, 05 Dec 2023 15:44:29 -0800 (PST) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id y15-20020a37e30f000000b007788bb0ab8esm5450429qki.19.2023.12.05.15.44.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2023 15:44:29 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Kalesh AP , Vikas Gupta , Somnath Kotur Subject: [PATCH net 3/4] bnxt_en: Fix wrong return value check in bnxt_close_nic() Date: Tue, 5 Dec 2023 15:44:03 -0800 Message-Id: <20231205234404.17501-4-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231205234404.17501-1-michael.chan@broadcom.com> References: <20231205234404.17501-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Kalesh AP The wait_event_interruptible_timeout() function returns 0 if the timeout elapsed, -ERESTARTSYS if it was interrupted by a signal, and the remaining jiffies otherwise if the condition evaluated to true before the timeout elapsed. Driver should have checked for zero return value instead of a positive value. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Reviewed-by: Vikas Gupta Reviewed-by: Somnath Kotur Signed-off-by: Kalesh AP --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index b4a5311bdeb5..16b7cf6b01a4 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -10753,7 +10753,7 @@ int bnxt_close_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init) rc = wait_event_interruptible_timeout(bp->sriov_cfg_wait, !bp->sriov_cfg, BNXT_SRIOV_CFG_WAIT_TMO); - if (rc) + if (!rc) netdev_warn(bp->dev, "timeout waiting for SRIOV config operation to complete!\n"); } #endif