xfrm: do not assume that template resolving always returns xfrms
authorTimo Teräs <timo.teras@iki.fi>
Mon, 12 Jul 2010 21:29:42 +0000 (21:29 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Jul 2010 21:16:48 +0000 (14:16 -0700)
xfrm_resolve_and_create_bundle() assumed that, if policies indicated
presence of xfrms, bundle template resolution would always return
some xfrms. This is not true for 'use' level policies which can
result in no xfrm's being applied if there is no suitable xfrm states.
This fixes a crash by this incorrect assumption.

Reported-by: George Spelvin <linux@horizon.com>
Bisected-by: George Spelvin <linux@horizon.com>
Tested-by: George Spelvin <linux@horizon.com>
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_policy.c

Simple merge