From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) by dpdk.org (Postfix) with ESMTP id 6929E5687 for ; Thu, 29 Sep 2016 21:07:03 +0200 (CEST) Received: by mail-it0-f50.google.com with SMTP id j69so2924021itb.0 for ; Thu, 29 Sep 2016 12:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jnENM5z1i+6t94tKA2vJIk60ikgvs4vTfIRNomkRjdg=; b=GHbLdftXyfbUTao9a8QAtCvzsEMtk8Aq75xrZWE4J2J6UMgcV1hqpfNacJEqZF1vHL P2zHahcpRPKE12zoIKzRGM/XCLj7MNziI+Eoid29/a5daZadKB5eYAOHp+Qn2Z8el0ve xbVYgTa7IJv6J5DqIXgeUsjwwWtGxBdvGy7vo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jnENM5z1i+6t94tKA2vJIk60ikgvs4vTfIRNomkRjdg=; b=aQuA24jzV3cRKK3R+gBf63ojD9Vkt9gQyauKM/18eMg9ssfC/SRt5YPTEG25LX/GO4 atPSOoZELSKV5QWGZNEtaQKEqJ/1VbUkuVXaIWq+F6+HdV2aN3owb3zqoz1rvz7zFYoW AaKUExX7y8m6I2A56CQO3QJZVvOFT+BsiQC8Jw7dYfnO+4uJi7oaJnOAG9Mv3j5btXzg JV1J5Yn4e2aqdMaZl5XYjuyMP9vI65szuO4wss8b94vbmL+xgjSUDJruHxz/71u45+ry 8ZGA8DskgmQL58z4aEvHznK7hi6E9PNv1Hyf3ZArFECpn+aUdttvGDDCGeZ8SeEnoyZB S0lA== X-Gm-Message-State: AA6/9RnmLwlph/cIv+ys9Uzus4vnPixL1AP23NvUK3VMddpjnYq+y9pkPYMsHF/DL/qwRKN8muIJFVtshqBh0+zJ X-Received: by 10.36.88.83 with SMTP id f80mr298798itb.36.1475176022573; Thu, 29 Sep 2016 12:07:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.195.225 with HTTP; Thu, 29 Sep 2016 12:06:22 -0700 (PDT) In-Reply-To: <1475170776-10130-3-git-send-email-linville@tuxdriver.com> References: <1475090404-20707-1-git-send-email-linville@tuxdriver.com> <1475170776-10130-1-git-send-email-linville@tuxdriver.com> <1475170776-10130-3-git-send-email-linville@tuxdriver.com> From: Ajit Khaparde Date: Thu, 29 Sep 2016 14:06:22 -0500 Message-ID: To: "John W. Linville" Cc: dev@dpdk.org, dpdk stable Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2 2/4] net/bnxt: ensure entry_length is unsigned in bnxt_alloc_vnic_attributes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2016 19:07:03 -0000 On Thu, Sep 29, 2016 at 12:39 PM, John W. Linville wrote: > Otherwise, the inherent cast when multiplying entry_length by max_vnics > in the call to rte_memzone_reserve could promote max_vnics to a signed > value, causing hilarity to ensue... > > Coverity issue: 127557 > Fixes: 9738793f28ec ("net/bnxt: add VNIC functions and structs") > > Signed-off-by: John W. Linville > =E2=80=8BAcked -by: Ajit Khaparde --- > v2: fix-up changelog entries based-on comments from Ferruh Yigit > > drivers/net/bnxt/bnxt_vnic.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c > index c04c4c740645..1b5f54c4d1ae 100644 > --- a/drivers/net/bnxt/bnxt_vnic.c > +++ b/drivers/net/bnxt/bnxt_vnic.c > @@ -175,7 +175,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) > struct rte_pci_device *pdev =3D bp->pdev; > const struct rte_memzone *mz; > char mz_name[RTE_MEMZONE_NAMESIZE]; > - int entry_length =3D RTE_CACHE_LINE_ROUNDUP( > + uint16_t entry_length =3D RTE_CACHE_LINE_ROUNDUP( > HW_HASH_INDEX_SIZE * > sizeof(*vnic->rss_table) + > HW_HASH_KEY_SIZE); > uint16_t max_vnics; > -- > 2.7.4 > >