mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
In err_on_hypervisor(), strstr() is called to search for "flags" in the buffer, but the return value is not checked before being used in pointer arithmetic (flags - buffer). If strstr() returns NULL because "flags" is not found in /proc/cpuinfo, this will cause undefined behavior and likely a crash. Add a NULL check after the strstr() call and handle the error appropriately by cleaning up resources and reporting a meaningful error message. Signed-off-by: Malaya Kumar Rout <mrout@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>