mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
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: a4a87fa4e9 ("xfrm: Add Direction to the SA in or out")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
parent
f584239a9e
commit
8d2a2a49c3
|
|
@ -2191,14 +2191,18 @@ 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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user