xfrm: properly handle invalid states as an error
authorTimo Teräs <timo.teras@iki.fi>
Wed, 22 May 2013 01:40:47 +0000 (01:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jun 2013 17:39:00 +0000 (10:39 -0700)
commit0a76328a972feb3ee70a7918e7b5f23406543bff
treeb55b56af8d1804d2f31310f13dabc8faef912030
parentbedc6277cbf2289a6a63bd83b20d89591d392336
xfrm: properly handle invalid states as an error

[ Upstream commit 497574c72c9922cf20c12aed15313c389f722fa0 ]

The error exit path needs err explicitly set. Otherwise it
returns success and the only caller, xfrm_output_resume(),
would oops in skb_dst(skb)->ops derefence as skb_dst(skb) is
NULL.

Bug introduced in commit bb65a9cb (xfrm: removes a superfluous
check and add a statistic).

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Cc: Li RongQing <roy.qing.li@gmail.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/xfrm/xfrm_output.c