summaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-27 21:57:03 -0700
committerDavid S. Miller <davem@davemloft.net>2012-06-27 21:57:03 -0700
commit1d1e34ddd48d27def2f324c1e3be16d460b16436 (patch)
tree79937379cbc0498cb3a611df4d14362dbe45f6cd /include/net/xfrm.h
parent160c85f0e050d92c0e42321aab2ffc343594e1c0 (diff)
downloadlinux-1d1e34ddd48d27def2f324c1e3be16d460b16436.tar.bz2
xfrm_user: Propagate netlink error codes properly.
Instead of using a fixed value of "-1" or "-EMSGSIZE", propagate what the nla_*() interfaces actually return. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index e0a55df5bde8..17acbc92476d 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1682,13 +1682,11 @@ static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m)
static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m)
{
- if ((m->m | m->v) &&
- nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m))
- goto nla_put_failure;
- return 0;
+ int ret = 0;
-nla_put_failure:
- return -1;
+ if (m->m | m->v)
+ ret = nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m);
+ return ret;
}
#endif /* _NET_XFRM_H */