projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d83ba4
)
xfrm: Stop using NLA_PUT*().
author
David S. Miller
<davem@davemloft.net>
Mon, 2 Apr 2012 01:04:21 +0000
(21:04 -0400)
committer
David S. Miller
<davem@davemloft.net>
Mon, 2 Apr 2012 08:33:45 +0000
(
04:33
-0400)
These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h
patch
|
blob
|
blame
|
history
diff --git
a/include/net/xfrm.h
b/include/net/xfrm.h
index 96239e78e621fa0654d9e436d8cbe50b8ebff5d0..1cb32bf107de65016cc43ab4f2f59085aeff3879 100644
(file)
--- a/
include/net/xfrm.h
+++ b/
include/net/xfrm.h
@@
-1682,8
+1682,9
@@
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);
+ if ((m->m | m->v) &&
+ nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m))
+ goto nla_put_failure;
return 0;
nla_put_failure: