Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: a4a87fa4e96c ("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>

authored by

Sabrina Dubroca and committed by
Steffen Klassert
8d2a2a49 f584239a

+6 -2
+6 -2
net/xfrm/xfrm_state.c
··· 2191 2191 } 2192 2192 2193 2193 if (x1->km.state == XFRM_STATE_ACQ) { 2194 - if (x->dir && x1->dir != x->dir) 2194 + if (x->dir && x1->dir != x->dir) { 2195 + to_put = x1; 2195 2196 goto out; 2197 + } 2196 2198 2197 2199 __xfrm_state_insert(x); 2198 2200 x = NULL; 2199 2201 } else { 2200 - if (x1->dir != x->dir) 2202 + if (x1->dir != x->dir) { 2203 + to_put = x1; 2201 2204 goto out; 2205 + } 2202 2206 } 2203 2207 err = 0; 2204 2208