netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] net: check return value for dst_alloc
@ 2011-09-26 17:04 Madalin Bucur
  2011-09-27 19:32 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Madalin Bucur @ 2011-09-26 17:04 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, davem, timo.teras, Madalin Bucur

return value of dst_alloc must be checked before use

Signed-off-by: Madalin Bucur <madalin.bucur@freescale.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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] net: check return value for dst_alloc
  2011-09-26 17:04 [PATCH 2/2] net: check return value for dst_alloc Madalin Bucur
@ 2011-09-27 19:32 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-09-27 19:32 UTC (permalink / raw)
  To: madalin.bucur; +Cc: eric.dumazet, netdev, timo.teras

From: Madalin Bucur <madalin.bucur@freescale.com>
Date: Mon, 26 Sep 2011 20:04:56 +0300

> return value of dst_alloc must be checked before use
> 
> Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-27 19:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-26 17:04 [PATCH 2/2] net: check return value for dst_alloc Madalin Bucur
2011-09-27 19:32 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).