mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 02:52:51 +03:00
gpu: nvgpu: Fix blockcount in lockless allocator
Make sure that the block count is the length / block_size since the length is passed in bytes. Change-Id: Ibb132b16b70b9cd7117c441f37a7947052d279ee Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1538976 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
2dcfd29861
commit
70c4496ca7
@@ -168,7 +168,7 @@ int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *__a,
|
||||
* Ensure we have space for at least one node & there's no overflow.
|
||||
* In order to control memory footprint, we require count < INT_MAX
|
||||
*/
|
||||
count = length;
|
||||
count = length / blk_size;
|
||||
if (!base || !count || count > INT_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user