aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/xfrm/xfrm_user.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index dac08e2a5a93..d12b62547ad0 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1548,6 +1548,7 @@ static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb,
1548{ 1548{
1549 struct xfrm_dump_info info; 1549 struct xfrm_dump_info info;
1550 struct sk_buff *skb; 1550 struct sk_buff *skb;
1551 int err;
1551 1552
1552 skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); 1553 skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
1553 if (!skb) 1554 if (!skb)
@@ -1558,9 +1559,10 @@ static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb,
1558 info.nlmsg_seq = seq; 1559 info.nlmsg_seq = seq;
1559 info.nlmsg_flags = 0; 1560 info.nlmsg_flags = 0;
1560 1561
1561 if (dump_one_policy(xp, dir, 0, &info) < 0) { 1562 err = dump_one_policy(xp, dir, 0, &info);
1563 if (err) {
1562 kfree_skb(skb); 1564 kfree_skb(skb);
1563 return NULL; 1565 return ERR_PTR(err);
1564 } 1566 }
1565 1567
1566 return skb; 1568 return skb;