diff options
| author | Hailong.Liu <[email protected]> | 2024-04-26 02:41:49 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-05-06 00:28:06 +0000 |
| commit | ac0476e8ca2e4125c0886d7d8d418b8e7cb17139 (patch) | |
| tree | 47c8eab642b220c0542651629d01cc96b1207110 /lib/test_xarray.c | |
| parent | mm: use memalloc_nofs_save() in page_cache_ra_order() (diff) | |
| download | kernel-ac0476e8ca2e4125c0886d7d8d418b8e7cb17139.tar.gz kernel-ac0476e8ca2e4125c0886d7d8d418b8e7cb17139.zip | |
mm/vmalloc: fix return value of vb_alloc if size is 0
vm_map_ram() uses IS_ERR() to validate the return value of vb_alloc(). If
vm_map_ram(page, 0, 0) is executed, vb_alloc(0, GFP_KERNEL) would return
NULL. In such a case, IS_ERR() cannot handle the return value and lead to
kernel panic by vmap_pages_range_noflush() at last. To resolve this
issue, return ERR_PTR(-EINVAL) if the size is 0.
Link: https://lkml.kernel.org/r/[email protected]
Reviewed-by: Barry Song <[email protected]>
Reviewed-by: Uladzislau Rezki (Sony) <[email protected]>
Signed-off-by: Hailong.Liu <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/test_xarray.c')
0 files changed, 0 insertions, 0 deletions
