From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 60066A0561; Thu, 18 Mar 2021 01:44:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 04EE440698; Thu, 18 Mar 2021 01:44:41 +0100 (CET) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) by mails.dpdk.org (Postfix) with ESMTP id 69E0B40683 for ; Thu, 18 Mar 2021 01:44:40 +0100 (CET) Received: by mail-qk1-f174.google.com with SMTP id n79so444998qke.3 for ; Wed, 17 Mar 2021 17:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m5L9LNIylkbfxRDUUWoGc91lDfSWWJH8im17U+vQT10=; b=U0UYJFE6pzg/fiWHRcvuWJcn2URq0IugjQsI/7GkSiLGPZyz1OEs0TP5mcwve8p6qE zIYoMS4Pa3BbEOsDG+Sk2h+lFu59u8vhji9hg2HrOKV474kS1ht35Xr/Owbwvn6+jmUi Sfgx35S+hRk3EM3VI21LqNIuXVQzmXu47sCKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m5L9LNIylkbfxRDUUWoGc91lDfSWWJH8im17U+vQT10=; b=HWkQfrBUaleCeZfue2gxyzr5C+I5SatnKKy+c3D9pl2twpBsV5i0ECt4yph1xAlGee o/EW7wmWWKQ5elt6dcl9wPCqTPihPK9uuGVUPJpqX9oeRWv0ZjQ+8K1M3d47GONFpk3S Qr0ebS66P8+7eNiExkYR1ok8zBJ+uczeH76LcN4sukggTfH5IjXVSR4JBOy8sfTm31k/ iW6HLnlLfhTtRau2l/Nw8DIR0eVEnLwVuNUpFXbzOhZkAs/fxsuMK3+gt0qxIgw79S71 pXZBZcS9mWF3MWOd5xmqDHURZ8a2+0bCV6nwTNGyzEXZ/YSlAUN/8Qu4Y64H5GK3HnYe yrzg== X-Gm-Message-State: AOAM531P+OgMAkYF6IPmamVe6qJn9zuN33xhv75HVCxyhSh5lFZFbIcy USbOF9hMR7e2bgvlGdhdvm5mcpCjjdpfQEGWqKXt4w== X-Google-Smtp-Source: ABdhPJydZgBDtID3oOGouMxshgHHItDOhVN1pslzNf9s+gIgipneJ4+TtILROonLgwtDiE56nxFec96XE3EjQS/BLec= X-Received: by 2002:a37:43cc:: with SMTP id q195mr2033846qka.455.1616028279610; Wed, 17 Mar 2021 17:44:39 -0700 (PDT) MIME-Version: 1.0 References: <20210316054125.980-1-kalesh-anakkur.purayil@broadcom.com> In-Reply-To: <20210316054125.980-1-kalesh-anakkur.purayil@broadcom.com> From: Ajit Khaparde Date: Wed, 17 Mar 2021 17:44:22 -0700 Message-ID: To: Kalesh A P Cc: dpdk-dev , Ferruh Yigit Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000930a2005bdc4e78c" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH] net/bnxt: fix unchecked return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" --000000000000930a2005bdc4e78c Content-Type: text/plain; charset="UTF-8" On Mon, Mar 15, 2021 at 10:19 PM Kalesh A P wrote: > > From: Kalesh AP > > CID 363716 (#1 of 1): Unchecked return value (CHECKED_RETURN) > check_return: Calling rte_pci_write_config without checking > return value (as is done elsewhere 46 out of 49 times). > > Coverity issue: 363716 > > Fixes: be14720def9c ("net/bnxt: support FW reset") > Cc: stable@dpdk.org > > Signed-off-by: Kalesh AP > Reviewed-by: Somnath Kotur Patch applied to dpdk-next-net-brcm. > --- > drivers/net/bnxt/bnxt_ethdev.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c > index 6cc6af0..202b082 100644 > --- a/drivers/net/bnxt/bnxt_ethdev.c > +++ b/drivers/net/bnxt/bnxt_ethdev.c > @@ -3860,13 +3860,19 @@ static void bnxt_write_fw_reset_reg(struct bnxt *bp, uint32_t index) > uint32_t val = info->reset_reg_val[index]; > uint32_t reg = info->reset_reg[index]; > uint32_t type, offset; > + int ret; > > type = BNXT_FW_STATUS_REG_TYPE(reg); > offset = BNXT_FW_STATUS_REG_OFF(reg); > > switch (type) { > case BNXT_FW_STATUS_REG_TYPE_CFG: > - rte_pci_write_config(bp->pdev, &val, sizeof(val), offset); > + ret = rte_pci_write_config(bp->pdev, &val, sizeof(val), offset); > + if (ret < 0) { > + PMD_DRV_LOG(ERR, "Failed to write %#x at PCI offset %#x", > + val, offset); > + return; > + } > break; > case BNXT_FW_STATUS_REG_TYPE_GRC: > offset = bnxt_map_reset_regs(bp, offset); > -- > 2.10.1 > --000000000000930a2005bdc4e78c--