Skip to content

Commit

Permalink
mlx4: fix kfree on error path in new_steering_entry()
Browse files Browse the repository at this point in the history
On error path kfree() should get pointer to memory allocated by
kmalloc() not the address of variable holding it (which is on stack).

Signed-off-by: Mariusz Kozlowski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
mkozlowski authored and davem330 committed Apr 4, 2011
1 parent 2fceec1 commit a14b289
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/mlx4/mcg.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 vep_num, u8 port,
u32 members_count;
struct mlx4_steer_index *new_entry;
struct mlx4_promisc_qp *pqp;
struct mlx4_promisc_qp *dqp;
struct mlx4_promisc_qp *dqp = NULL;
u32 prot;
int err;
u8 pf_num;
Expand Down Expand Up @@ -184,7 +184,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 vep_num, u8 port,
out_alloc:
if (dqp) {
list_del(&dqp->list);
kfree(&dqp);
kfree(dqp);
}
list_del(&new_entry->list);
kfree(new_entry);
Expand Down

0 comments on commit a14b289

Please sign in to comment.