From: Dan Carpenter Date: Mon, 4 Feb 2013 11:22:36 +0000 (+0000) Subject: IB/mlx4: Fix bug unwinding on error in mlx4_ib_init_sriov() X-Git-Tag: v3.9-rc1~72^2^6~12 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cab66d1273e6490603cf5256155584d38cecca68;p=pandora-kernel.git IB/mlx4: Fix bug unwinding on error in mlx4_ib_init_sriov() 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 Signed-off-by: Roland Dreier --- Reading git-diff-tree failed