diff mbox

ipv6: Fix dst_release of invalid pointer

Message ID 20100127070802.26065.73104.sendpatchset@krkumar2.in.ibm.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Krishna Kumar Jan. 27, 2010, 7:08 a.m. UTC
Fix dst_release on a invalid region.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
 net/ipv6/addrconf.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Jan. 27, 2010, 7:11 a.m. UTC | #1
From: Krishna Kumar <krkumar2@in.ibm.com>
Date: Wed, 27 Jan 2010 12:38:02 +0530

> Fix dst_release on a invalid region.
> 
> Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>

NULL, is NULL, is NULL, and always will be NULL.

Even if rt == NULL, &rt->u.dst will be NULL too.

So it's just plain NULL.

You NULL that? :-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Krishna Kumar Jan. 27, 2010, 7:59 a.m. UTC | #2
David Miller <davem@davemloft.net> wrote on 01/27/2010 12:41:33 PM:

> From: Krishna Kumar <krkumar2@in.ibm.com>
> Date: Wed, 27 Jan 2010 12:38:02 +0530
>
> > Fix dst_release on a invalid region.
> >
> > Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
>
> NULL, is NULL, is NULL, and always will be NULL.
>
> Even if rt == NULL, &rt->u.dst will be NULL too.
>
> So it's just plain NULL.
>
> You NULL that? :-)

Yes :)

I forgot dst_entry was the first element in rt6_info.

thanks,

- KK

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff -ruNp org/net/ipv6/addrconf.c new/net/ipv6/addrconf.c
--- org/net/ipv6/addrconf.c	2010-01-27 10:03:28.000000000 +0530
+++ new/net/ipv6/addrconf.c	2010-01-27 10:04:00.000000000 +0530
@@ -823,7 +823,8 @@  static void ipv6_del_addr(struct inet6_i
 				rt->rt6i_flags |= RTF_EXPIRES;
 			}
 		}
-		dst_release(&rt->u.dst);
+		if (rt)
+			dst_release(&rt->u.dst);
 	}
 
 	in6_ifa_put(ifp);