From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: caihe <caihe@huawei.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
wangyunjian <wangyunjian@huawei.com>,
"Lilijun (Jerry)" <jerry.lilijun@huawei.com>,
Zhoujingbin <zhoujingbin@huawei.com>,
Kumar Sanghvi <kumaras@chelsio.com>,
Nirranjan Kirubaharan <nirranjan@chelsio.com>
Subject: Re: [dpdk-dev] [PATCH 1/1] net/cxgbe: check return value of malloc
Date: Mon, 27 Mar 2017 13:05:12 +0530 [thread overview]
Message-ID: <20170327073511.GA31514@chelsio.com> (raw)
In-Reply-To: <453363AE6316CC428D594009B784F9050335F159@SZXEMI508-MBS.china.huawei.com>
On Saturday, March 03/25/17, 2017 at 18:14:29 +0530, caihe wrote:
> Hi rahul,
>
> There is a bug without check the return value of alloc memory in function
> t4_wr_mbox_meat_timeout, if we should fix it as below:
>
> diff --git a/drivers/net/cxgbe/base/t4_hw.c
> b/drivers/net/cxgbe/base/t4_hw.c
> index c089b06..7402a5f 100644
> --- a/drivers/net/cxgbe/base/t4_hw.c
> +++ b/drivers/net/cxgbe/base/t4_hw.c
> @@ -359,6 +359,10 @@ 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;
>
> Best Regards
Thanks for the fix! However, there seem to be checkpatch issues with
the patch that need to be fixed.
http://dpdk.org/ml/archives/test-report/2017-March/015606.html
Thanks,
Rahul
prev parent reply other threads:[~2017-03-27 7:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-25 12:44 caihe
2017-03-27 7:35 ` Rahul Lakkireddy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170327073511.GA31514@chelsio.com \
--to=rahul.lakkireddy@chelsio.com \
--cc=caihe@huawei.com \
--cc=dev@dpdk.org \
--cc=jerry.lilijun@huawei.com \
--cc=kumaras@chelsio.com \
--cc=nirranjan@chelsio.com \
--cc=wangyunjian@huawei.com \
--cc=zhoujingbin@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).