aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMariusz Kozlowski <mk@lab.zgora.pl>2011-04-04 01:04:01 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-04 01:04:01 -0400
commita14b289d4614bb3b25d0455d68f72f3c7b4cc8e8 (patch)
treee7feb055039bf9040dff0fd662e4685d8a302def /drivers/net
parent2fceec13375e5d98ef033c6b0ee03943fc460950 (diff)
mlx4: fix kfree on error path in new_steering_entry()
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 <mk@lab.zgora.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/mlx4/mcg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c
index 37150b2f6425..c6d336aed2d9 100644
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -111,7 +111,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 vep_num, u8 port,
111 u32 members_count; 111 u32 members_count;
112 struct mlx4_steer_index *new_entry; 112 struct mlx4_steer_index *new_entry;
113 struct mlx4_promisc_qp *pqp; 113 struct mlx4_promisc_qp *pqp;
114 struct mlx4_promisc_qp *dqp; 114 struct mlx4_promisc_qp *dqp = NULL;
115 u32 prot; 115 u32 prot;
116 int err; 116 int err;
117 u8 pf_num; 117 u8 pf_num;
@@ -184,7 +184,7 @@ out_mailbox:
184out_alloc: 184out_alloc:
185 if (dqp) { 185 if (dqp) {
186 list_del(&dqp->list); 186 list_del(&dqp->list);
187 kfree(&dqp); 187 kfree(dqp);
188 } 188 }
189 list_del(&new_entry->list); 189 list_del(&new_entry->list);
190 kfree(new_entry); 190 kfree(new_entry);