Description of problem: When checking pg->records[pg->index - 1].ip in lookup_rec(), it can get a pg which is newly added to ftrace_pages_start in ftrace_process_locs(). Before the first pg->index++, index is 0 and accessing pg->records[-1].ip will cause this problem. Version-Release number of selected component (if applicable): 4.19 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: