[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1317056696-23611-1-git-send-email-madalin.bucur@freescale.com>
Date: Mon, 26 Sep 2011 20:04:56 +0300
From: Madalin Bucur <madalin.bucur@...escale.com>
To: <eric.dumazet@...il.com>
CC: <netdev@...r.kernel.org>, <davem@...emloft.net>,
<timo.teras@....fi>, Madalin Bucur <madalin.bucur@...escale.com>
Subject: [PATCH 2/2] net: check return value for dst_alloc
return value of dst_alloc must be checked before use
Signed-off-by: Madalin Bucur <madalin.bucur@...escale.com>
---
net/ipv6/route.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1250f90..fb545ed 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -244,7 +244,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;
}
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists