Skip to content

Commit

Permalink
net/mlx5: use kvfree() for memory allocated with kvzalloc()
Browse files Browse the repository at this point in the history
It is allocated with kvzalloc(), the corresponding release function
should not be kfree(), use kvfree() instead.

Generated by: scripts/coccinelle/api/kfree_mismatch.cocci

Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Junlin Yang authored and Saeed Mahameed committed Mar 12, 2021
1 parent cc82a2e commit ad2c99c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw,
err_ethertype:
kfree(rule);
out:
kfree(rule_spec);
kvfree(rule_spec);
return err;
}

Expand Down Expand Up @@ -328,7 +328,7 @@ static int mlx5_create_indir_recirc_group(struct mlx5_eswitch *esw,
e->recirc_cnt = 0;

out:
kfree(in);
kvfree(in);
return err;
}

Expand All @@ -347,7 +347,7 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw,

spec = kvzalloc(sizeof(*spec), GFP_KERNEL);
if (!spec) {
kfree(in);
kvfree(in);
return -ENOMEM;
}

Expand All @@ -371,8 +371,8 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw,
}

err_out:
kfree(spec);
kfree(in);
kvfree(spec);
kvfree(in);
return err;
}

Expand Down

0 comments on commit ad2c99c

Please sign in to comment.