From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id ED0BEFA3C for ; Thu, 30 Mar 2017 13:29:18 +0200 (CEST) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id v2UBTFn0007766; Thu, 30 Mar 2017 04:29:16 -0700 Date: Thu, 30 Mar 2017 16:58:36 +0530 From: Rahul Lakkireddy To: henry Cc: "dev@dpdk.org" , Nirranjan Kirubaharan , "wangyunjian@huawei.com" , "zhoujingbin@huawei.com" , Kumar Sanghvi Message-ID: <20170330112835.GA4937@chelsio.com> References: <1490686340-9340-1-git-send-email-caihe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1490686340-9340-1-git-send-email-caihe@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH v2] net/cxgbe: fix a bug in t4_wr_mbox_meat_timeout X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 11:29:19 -0000 On Tuesday, March 03/28/17, 2017 at 13:02:20 +0530, henry wrote: > Check return value of malloc > > Signed-off-by: henry > --- >  drivers/net/cxgbe/base/t4_hw.c | 3 +++ >  1 file changed, 3 insertions(+) > > diff --git a/drivers/net/cxgbe/base/t4_hw.c > b/drivers/net/cxgbe/base/t4_hw.c > index c089b06..9dca8da 100644 > --- a/drivers/net/cxgbe/base/t4_hw.c > +++ b/drivers/net/cxgbe/base/t4_hw.c > @@ -359,6 +359,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int > mbox, >          struct mbox_entry entry; >          u32 pcie_fw = 0; >   > +       if (!temp) > +               return -ENOMEM; > + >          if ((size & 15) || size > MBOX_LEN) { >                  free(temp); >                  return -EINVAL; > -- > 1.8.3.1 Thanks for the fix! Acked-by: Rahul Lakkireddy