[dpdk-dev,v2] net/cxgbe: fix a bug in t4_wr_mbox_meat_timeout
Checks
Commit Message
Check return value of malloc
Signed-off-by: henry <caihe@huawei.com>
---
drivers/net/cxgbe/base/t4_hw.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On Tuesday, March 03/28/17, 2017 at 13:02:20 +0530, henry wrote:
> Check return value of malloc
>
> Signed-off-by: henry <caihe@huawei.com>
> ---
> 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 <rahul.lakkireddy@chelsio.com>
On 3/28/2017 8:32 AM, henry wrote:
> Check return value of malloc
>
> Signed-off-by: henry <caihe@huawei.com>
Hi henry,
Full name is required for sign-off and author fields.
Since patch already acked, if you can provide the information, I can
update the patch while applying, not new version of the patch required.
Required format is:
Name Surname <my@mail.com>
Thanks,
ferruh
On 3/30/2017 5:08 PM, Ferruh Yigit wrote:
> On 3/28/2017 8:32 AM, henry wrote:
>> Check return value of malloc
>>
>> Signed-off-by: henry <caihe@huawei.com>
>
> Hi henry,
>
> Full name is required for sign-off and author fields.
>
> Since patch already acked, if you can provide the information, I can
> update the patch while applying, not new version of the patch required.
>
> Required format is:
> Name Surname <my@mail.com>
"Henry Cai <caihe@huawei.com>"
will be used for author and signed-off fields, based on information
provided by author.
>
> Thanks,
> ferruh
On 3/30/2017 12:28 PM, Rahul Lakkireddy wrote:
> On Tuesday, March 03/28/17, 2017 at 13:02:20 +0530, henry wrote:
>> Check return value of malloc
>>
>> Signed-off-by: henry <caihe@huawei.com>
Signed-off-by: Henry Cai <caihe@huawei.com>
> Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Applied to dpdk-next-net/master, thanks.
@@ -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;