diff options
Diffstat (limited to 'net/ipv6/calipso.c')
-rw-r--r-- | net/ipv6/calipso.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/calipso.c b/net/ipv6/calipso.c index c53b92c617c5..37ac9de713c6 100644 --- a/net/ipv6/calipso.c +++ b/net/ipv6/calipso.c | |||
@@ -952,8 +952,10 @@ calipso_opt_insert(struct ipv6_opt_hdr *hop, | |||
952 | memcpy(new, hop, start); | 952 | memcpy(new, hop, start); |
953 | ret_val = calipso_genopt((unsigned char *)new, start, buf_len, doi_def, | 953 | ret_val = calipso_genopt((unsigned char *)new, start, buf_len, doi_def, |
954 | secattr); | 954 | secattr); |
955 | if (ret_val < 0) | 955 | if (ret_val < 0) { |
956 | kfree(new); | ||
956 | return ERR_PTR(ret_val); | 957 | return ERR_PTR(ret_val); |
958 | } | ||
957 | 959 | ||
958 | buf_len = start + ret_val; | 960 | buf_len = start + ret_val; |
959 | /* At this point buf_len aligns to 4n, so (buf_len & 4) pads to 8n */ | 961 | /* At this point buf_len aligns to 4n, so (buf_len & 4) pads to 8n */ |