From patchwork Thu Dec 7 00:05:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13482501 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="TC5biusA" Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6793E10D9 for ; Wed, 6 Dec 2023 16:06:11 -0800 (PST) Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-67aa3b62c35so2104176d6.0 for ; Wed, 06 Dec 2023 16:06:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1701907570; x=1702512370; 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=Bw5sNGv3VbIRSF4MrQ2S3JRjWP8i2DBnkqSzM3oAGUc=; b=TC5biusATDaHkvSbxdCzidGksyA7hK42aDZIsTar/4GLNr9tCwBHKABSGpS+OeqK0i /DI3pjXjSTvK4bdQpzf1x0iOAif4Gg1q0vZeanfUcGCNvT9GPu1ZNHciaEHTrpUGJmvJ JGNhL6ZlW9xoVw1JdGqUO8bFAYGtISOeOYUDM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701907570; x=1702512370; 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=Bw5sNGv3VbIRSF4MrQ2S3JRjWP8i2DBnkqSzM3oAGUc=; b=VLOj9rRH0VMwxpqhlWTDNt0nji2GDiLy+H2CgPFga19RcK5QFVk6p3Qo470uANS+b7 IPtveGpH8ES91uPjZ246n2e9YAOpyxytEeNdcEzfFur29FKCg8taH+qP8JhSb181xTAS 7ljEHXhdFKZrEGw8WrQTND1DNgNwmEv7uyyugOY6aPbnY2taiCMshFKqWo5angZYVP91 CMCN+VVC8b++//uT5+y/kpA+3pTkYJsxtpHR3GHjBxdxm890wnSmDMx3WCn27XLWQOzg 3t4LXxPTUEW7+FnCiI9JvVge6DAwC0C8YbswFawtpN7gpEt/CDFp4CzTD1+zSygPU4dN dTCw== X-Gm-Message-State: AOJu0YwKar0Gq9kYS3EIG1xw+MOR+ClMjy83iVoa7PvdRSeiGU5bNEO+ YaI3507LrJ/IKbObvnCso3Sreg== X-Google-Smtp-Source: AGHT+IEmQOhR8Z//m+RP0oiDKtzlOh6/5l3+mAj5iq3Ka7jeqdRX7vQgkioDxcWJpej8fuIVgc3SWA== X-Received: by 2002:ad4:4212:0:b0:67a:a721:e121 with SMTP id k18-20020ad44212000000b0067aa721e121mr2001811qvp.78.1701907570345; Wed, 06 Dec 2023 16:06:10 -0800 (PST) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id a11-20020a05620a102b00b0077d78afc513sm23091qkk.110.2023.12.06.16.06.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2023 16:06:09 -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 v2 3/4] bnxt_en: Fix wrong return value check in bnxt_close_nic() Date: Wed, 6 Dec 2023 16:05:50 -0800 Message-Id: <20231207000551.138584-4-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231207000551.138584-1-michael.chan@broadcom.com> References: <20231207000551.138584-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 Signed-off-by: Michael Chan --- v2: Add missing SoB tag. --- 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