IB/mlx4: Fix bug unwinding on error in mlx4_ib_init_sriov()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 4 Feb 2013 11:22:36 +0000 (11:22 +0000)
committerRoland Dreier <roland@purestorage.com>
Fri, 15 Feb 2013 23:22:26 +0000 (15:22 -0800)
We have to decrement "i" before calling mlx4_ib_free_demux_ctx() or we
free something that wasn't allocated.  That's fine for free_pv_object()
but it would lead to a NULL dereference calling mlx4_ib_free_demux_ctx().
The null dereference is because ->tun is NULL when we check:

if (!ctx->tun[i])

Also we didn't free ->sriov.demux[0] so it was a small leak.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>

No differences found