Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hugetlb: fix NULL pointer dereference in trace_hugetlbfs_alloc_inode
hugetlb_file_setup() will pass a NULL @dir to hugetlbfs_get_inode(), so we will access a NULL pointer for @dir. Fix it and set __entry->dr to 0 if @dir is NULL. Because ->i_ino cannot be 0 (see get_next_ino()), there is no confusing if user sees a 0 inode number. Link: https://lkml.kernel.org/r/[email protected] Fixes: 318580a ("hugetlbfs: support tracepoint") Signed-off-by: Muchun Song <[email protected]> Reported-by: Cheung Wall <[email protected]> Closes: https://lore.kernel.org/linux-mm/[email protected]/T/# Reviewed-by: Hongbo Li <[email protected]> Cc: cheung wall <[email protected]> Cc: Christian Brauner <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
- Loading branch information