]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
accel/amdxdna: Use unsigned long for nr_pages in amdxdna_hmm_register()
authorLizhi Hou <lizhi.hou@amd.com>
Tue, 16 Jun 2026 06:15:32 +0000 (23:15 -0700)
committerLizhi Hou <lizhi.hou@amd.com>
Tue, 7 Jul 2026 05:34:56 +0000 (22:34 -0700)
commit18aaebdf43366954345a6721ed2bff3ac3c9fa61
tree78b92a61aaa53bd09f90d90dfb41f16c731887a7
parente35c9cf5512814fb04f369f2eada64f0a7164609
accel/amdxdna: Use unsigned long for nr_pages in amdxdna_hmm_register()

nr_pages is declared as u32 in amdxdna_hmm_register(), which may not be
large enough to represent the number of pages for large mappings.

Use unsigned long for nr_pages to avoid potential overflow.

Fixes: ac49797c1815 ("accel/amdxdna: Add GEM buffer object management")
Reviewed-by: Max Zhen <max.zhen@amd.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260616061532.3533469-1-lizhi.hou@amd.com
drivers/accel/amdxdna/amdxdna_gem.c