[dpdk-dev] net/enic:fix no return value bug
Checks
Commit Message
In enic_alloc_consistent() function, if the value mze malloc
faile, !mze is true, free the rz should return NULL.
Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>
---
drivers/net/enic/enic_main.c | 1 +
1 file changed, 1 insertion(+)
Comments
On 8/23/2017 9:49 AM, Rongqiang XIE wrote:
> In enic_alloc_consistent() function, if the value mze malloc
> faile, !mze is true, free the rz should return NULL.
>
> Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
On 8/28/2017 12:31 PM, Ferruh Yigit wrote:
> On 8/23/2017 9:49 AM, Rongqiang XIE wrote:
>> In enic_alloc_consistent() function, if the value mze malloc
>> faile, !mze is true, free the rz should return NULL.
>>
>> Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>
>
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/master, thanks.
@@ -368,6 +368,7 @@ void enic_init_vnic_resources(struct enic *enic)
pr_err("%s : Failed to allocate memory for memzone list\n",
__func__);
rte_memzone_free(rz);
+ return NULL;
}
mze->rz = rz;