提交 bfeda968 编写于 作者: Y Yang Yingliang 提交者: Saeed Mahameed

net/mlx5e: TC, fix return value check in mlx5e_tc_act_stats_create()

kvzalloc() returns NULL pointer not PTR_ERR() when it fails,
so replace the IS_ERR() check with NULL pointer check.

Fixes: d13674b1 ("net/mlx5e: TC, map tc action cookie to a hw counter")
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NRoi Dayan <roid@nvidia.com>
Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
上级 0483a16b
......@@ -37,7 +37,7 @@ mlx5e_tc_act_stats_create(void)
int err;
handle = kvzalloc(sizeof(*handle), GFP_KERNEL);
if (IS_ERR(handle))
if (!handle)
return ERR_PTR(-ENOMEM);
err = rhashtable_init(&handle->ht, &act_counters_ht_params);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册