Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cipso: cleanup cipso_v4_translate() when !CONFIG_NETLABEL

Don't needlessly recompute 'opt[opt_iter + 1]' as we already have it
stored in 'tag_len'.

Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Paul Moore and committed by
David S. Miller
10ae76fa 971a351c

+1 -1
+1 -1
include/net/cipso_ipv4.h
··· 303 303 304 304 for (opt_iter = 6; opt_iter < opt_len;) { 305 305 tag_len = opt[opt_iter + 1]; 306 - if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) { 306 + if ((tag_len == 0) || (tag_len > (opt_len - opt_iter))) { 307 307 err_offset = opt_iter + 1; 308 308 goto out; 309 309 }