From: roel kluin Date: Wed, 29 Oct 2008 19:55:53 +0000 (-0400) Subject: cipso: unsigned buf_len cannot be negative X-Git-Tag: v2.6.28-rc3~3^2~8^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=00af5c69598212cf6cd4ecb4ca89785118aeecad;p=linux-2.6-omap-h63xx.git cipso: unsigned buf_len cannot be negative unsigned buf_len cannot be negative Signed-off-by: Roel Kluin Signed-off-by: Paul Moore --- diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index 490e035c6d9..2e78f6bd977 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c @@ -2063,9 +2063,10 @@ int cipso_v4_skbuff_setattr(struct sk_buff *skb, u32 opt_len; int len_delta; - buf_len = cipso_v4_genopt(buf, buf_len, doi_def, secattr); - if (buf_len < 0) - return buf_len; + ret_val = cipso_v4_genopt(buf, buf_len, doi_def, secattr); + if (ret_val < 0) + return ret_val; + buf_len = ret_val; opt_len = (buf_len + 3) & ~3; /* we overwrite any existing options to ensure that we have enough