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: d13674b1d1
("net/mlx5e: TC, map tc action cookie to a hw counter")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
0483a16bc4
commit
bfeda9683d
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue