mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: cde: fix off-by-1 in buf allocation
Bug 200046882 Change-Id: I515e972f84cb7e1b17eef42ade6a4eaf0f8d71f8 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/559332 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
Dan Willemsen
parent
75af9eb590
commit
ddfa305151
@@ -244,7 +244,7 @@ static int gk20a_init_cde_buf(struct gk20a_cde_ctx *cde_ctx,
|
||||
}
|
||||
|
||||
/* check that we have enough buf elems available */
|
||||
if (cde_ctx->num_bufs > MAX_CDE_BUFS) {
|
||||
if (cde_ctx->num_bufs >= MAX_CDE_BUFS) {
|
||||
gk20a_warn(&cde_ctx->pdev->dev, "cde: invalid data section. buffer idx = %d",
|
||||
cde_ctx->num_bufs);
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user