Skip to content

Commit bfeda96

Browse files
Yang YingliangSaeed Mahameed
authored andcommitted
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: d13674b ("net/mlx5e: TC, map tc action cookie to a hw counter") Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 0483a16 commit bfeda96

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en/tc

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act_stats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ mlx5e_tc_act_stats_create(void)
3737
int err;
3838

3939
handle = kvzalloc(sizeof(*handle), GFP_KERNEL);
40-
if (IS_ERR(handle))
40+
if (!handle)
4141
return ERR_PTR(-ENOMEM);
4242

4343
err = rhashtable_init(&handle->ht, &act_counters_ht_params);

0 commit comments

Comments
 (0)