Skip to content

Commit 37207b6

Browse files
qianfengronggregkh
authored andcommitted
drm/nouveau/gsp: fix mismatched alloc/free for kvmalloc()
commit 989fe67 upstream. Replace kfree() with kvfree() for memory allocated by kvmalloc(). Compile-tested only. Cc: stable@vger.kernel.org Fixes: 8a8b1ec ("drm/nouveau/gsp: split rpc handling out on its own") Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Reviewed-by: Timur Tabi <ttabi@nvidia.com> Acked-by: Zhi Wang <zhiw@nvidia.com> Link: https://lore.kernel.org/r/20250813125412.96178-1-rongqianfeng@vivo.com Signed-off-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ec9e405 commit 37207b6

File tree

1 file changed

+2
-2
lines changed
  • drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535

1 file changed

+2
-2
lines changed

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/rpc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ r535_gsp_msgq_recv(struct nvkm_gsp *gsp, u32 gsp_rpc_len, int *retries)
325325

326326
rpc = r535_gsp_msgq_peek(gsp, sizeof(*rpc), info.retries);
327327
if (IS_ERR_OR_NULL(rpc)) {
328-
kfree(buf);
328+
kvfree(buf);
329329
return rpc;
330330
}
331331

@@ -334,7 +334,7 @@ r535_gsp_msgq_recv(struct nvkm_gsp *gsp, u32 gsp_rpc_len, int *retries)
334334

335335
rpc = r535_gsp_msgq_recv_one_elem(gsp, &info);
336336
if (IS_ERR_OR_NULL(rpc)) {
337-
kfree(buf);
337+
kvfree(buf);
338338
return rpc;
339339
}
340340

0 commit comments

Comments
 (0)