In the Linux kernel, the following vulnerability has been resolved:
KEYS: prevent NULL pointer dereference in findasymmetrickey()
In findasymmetrickey(), if all NULLs are passed in the id{0,1,2} arguments, the kernel will first emit WARN but then have an oops because id2 gets dereferenced anyway.
Add the missing id2 check and move WARNON() to the final else branch to avoid duplicate NULL checks.
Found by Linux Verification Center (linuxtesting.org) with Svace static analysis tool.