Files
rockchip-kernel/drivers/gpu/drm
Jianglei Nie 3339a51bcd drm/nouveau/nouveau_bo: fix potential memory leak in nouveau_bo_alloc()
[ Upstream commit 6dc548745d ]

nouveau_bo_alloc() allocates a memory chunk for "nvbo" with kzalloc().
When some error occurs, "nvbo" should be released. But when
WARN_ON(pi < 0)) equals true, the function return ERR_PTR without
releasing the "nvbo", which will lead to a memory leak.

We should release the "nvbo" with kfree() if WARN_ON(pi < 0)) equals true.

Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220705094306.2244103-1-niejianglei2021@163.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:25:48 +02:00
..
2020-08-11 11:58:31 +10:00
2020-09-08 14:41:40 +10:00
2020-09-11 10:47:19 +02:00
2021-05-11 14:47:26 +02:00
2020-05-27 14:31:42 +03:00
2020-05-29 12:58:11 +02:00
2020-09-21 10:45:08 +02:00
2022-10-26 13:25:25 +02:00