Commit 8d2a2a49 authored by Sabrina Dubroca's avatar Sabrina Dubroca Committed by Steffen Klassert
Browse files

xfrm: drop SA reference in xfrm_state_update if dir doesn't match



We're not updating x1, but we still need to put() it.

Fixes: a4a87fa4 ("xfrm: Add Direction to the SA in or out")
Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent f584239a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2191,15 +2191,19 @@ int xfrm_state_update(struct xfrm_state *x)
	}

	if (x1->km.state == XFRM_STATE_ACQ) {
		if (x->dir && x1->dir != x->dir)
		if (x->dir && x1->dir != x->dir) {
			to_put = x1;
			goto out;
		}

		__xfrm_state_insert(x);
		x = NULL;
	} else {
		if (x1->dir != x->dir)
		if (x1->dir != x->dir) {
			to_put = x1;
			goto out;
		}
	}
	err = 0;

out: