[NETLINK]: Fix RTA_NEST_CANCEL().
authorThomas Graf <tgraf@suug.ch>
Sun, 19 Jun 2005 05:51:26 +0000 (22:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Jun 2005 05:51:26 +0000 (22:51 -0700)
Only skb_trim() if 'start' is non-NULL.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rtnetlink.h

index 5a5cda1602674b18bfad707a08d636693f8b359e..6fff8c4c99c7ab57226120bbd143d94f451c08d6 100644 (file)
@@ -924,7 +924,8 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
        (skb)->len; })
 
 #define RTA_NEST_CANCEL(skb, start) \
-({     skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
+({     if (start) \
+               skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
        -1; })
 
 #define RTA_GET_U32(rta) \