projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25914de
)
ipv6: check return value for dst_alloc
author
Madalin Bucur
<madalin.bucur@freescale.com>
Mon, 26 Sep 2011 07:04:56 +0000
(07:04 +0000)
committer
JP Abgrall
<jpa@google.com>
Thu, 10 May 2012 05:28:24 +0000
(22:28 -0700)
return value of dst_alloc must be checked before use
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c
patch
|
blob
|
history
diff --git
a/net/ipv6/route.c
b/net/ipv6/route.c
index 8e600f827fe7c9b9e43c3cccd6332c4ce5d964d1..7ef5d08201859227451a857a1d480a69fcc34d27 100644
(file)
--- a/
net/ipv6/route.c
+++ b/
net/ipv6/route.c
@@
-233,7
+233,9
@@
static inline struct rt6_info *ip6_dst_alloc(struct dst_ops *ops,
{
struct rt6_info *rt = dst_alloc(ops, dev, 0, 0, flags);
- memset(&rt->rt6i_table, 0, sizeof(*rt) - sizeof(struct dst_entry));
+ if (rt != NULL)
+ memset(&rt->rt6i_table, 0,
+ sizeof(*rt) - sizeof(struct dst_entry));
return rt;
}