Subject: [PATCH] xfrm: fix error checking in xfrm_output_gso

From: "Yan, Zheng" <[email-masked]>
Date: Thu, 27 Oct 2011 13:33:18 +0800

xfrm_output2() returns 1 on success. This bug makes xfrm_output_gso()
drop all segments except the first one.

Signed-off-by: Zheng Yan <[email-masked]>
---
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 47bacd8..04e963a 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -159,7 +159,7 @@ static int xfrm_output_gso(struct sk_buff *skb)
 		segs->next = NULL;
 		err = xfrm_output2(segs);
 
-		if (unlikely(err)) {
+		if (unlikely(err < 0)) {
 			while ((segs = nskb)) {
 				nskb = segs->next;
 				segs->next = NULL;