Yes, this can be caught by a static analyzer and it is sad that Linux doesn't use it. I wonder, is it because the code quality is low and there would be too many warnings?
And it's because the kernel does a lot of non-standard things, mostly because it has to. It is not a normal program.