Skip to content

Commit d10285a

Browse files
karolherbstairlied
authored andcommitted
drm/nouveau/mem: guard against NULL pointer access in mem_del
other drivers seems to do something similar Signed-off-by: Karol Herbst <[email protected]> Cc: dri-devel <[email protected]> Cc: Dave Airlie <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c3e0276 commit d10285a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/nouveau/nouveau_mem.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ void
176176
nouveau_mem_del(struct ttm_mem_reg *reg)
177177
{
178178
struct nouveau_mem *mem = nouveau_mem(reg);
179+
if (!mem)
180+
return;
179181
nouveau_mem_fini(mem);
180182
kfree(reg->mm_node);
181183
reg->mm_node = NULL;

0 commit comments

Comments
 (0)