hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/release-management/issues/ID5CMS -------------------------------- We get PFI from get_pfi(), but we didn't check if the PFI is valid. Since PFI is NULL, and we access pfi->file directly, panic happens. To solve this issue, add a NULL ptr check in __do_sys_epoll_pwait(). Fixes: 318abedea4be ("xcall2.0: prefetch: introduce struct prefetch_mm_data") Signed-off-by: Xinyu Zheng <zhengxinyu6@huawei.com> --- drivers/staging/xcall/prefetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/xcall/prefetch.c b/drivers/staging/xcall/prefetch.c index b4c9f507ed35..91cde4812769 100644 --- a/drivers/staging/xcall/prefetch.c +++ b/drivers/staging/xcall/prefetch.c @@ -475,7 +475,7 @@ static long __do_sys_epoll_pwait(struct pt_regs *regs) continue; pfi = get_pfi(fd); - if (!(pfi->file) || !(pfi->file->f_mode & FMODE_READ)) + if (!pfi || !(pfi->file) || !(pfi->file->f_mode & FMODE_READ)) continue; if (atomic_read(&pfi->state) != XCALL_CACHE_NONE) continue; -- 2.34.1