mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-02 06:04:52 -05:00
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:
committed by
Saeed Mahameed
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);
|
||||
|
||||
Reference in New Issue
Block a user