YOSHIFUJI Hideaki wrote:
In article <[EMAIL PROTECTED]> (at Fri, 17 Nov 2006 15:26:28 +0200), Ville Nuorvala
<[EMAIL PROTECTED]> says:
- dst_release(&rt->u.dst);
+ if (rt)
+ dst_release(&rt->u.dst);
}
I disagree. This does NOT fix any bugs.
(void *)&rt->u.dst is ever equal to (void*)rt, and
dst_release() checks if the argument is NULL.
As the check is unnecessary you probably want to clean up the other
places where rt is checked before &rt->u.dst is passed, as well ;-)
This is done at least in addrconf.c, ndisc.c and route.c...
Seriously though, you are probably right about the pointer being equal
to NULL in this case, but does the C language actually guarantee that
the pointer to the structure and its first element are equal, or is it
implementation dependent? I don't have my K&R here, so I can't check.
Regards,
Ville
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html