Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a14b289d authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by David S. Miller
Browse files

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: default avatarMariusz Kozlowski <mk@lab.zgora.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2fceec13
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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);