mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-03 13:46:38 +07:00
drm/nouveau: do not leak in nv20_graph_create
If we return due to an unknown chipset in drivers/gpu/drm/nouveau/nv20_graph.c:nv20_graph_create() we'll leak the memory allocated to 'pgraph'. This patch should fix the leak. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Reviewed-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
88c8431cbb
commit
1541fa8542
@ -753,6 +753,7 @@ nv20_graph_create(struct drm_device *dev)
|
||||
break;
|
||||
default:
|
||||
NV_ERROR(dev, "PGRAPH: unknown chipset\n");
|
||||
kfree(pgraph);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
@ -774,6 +775,7 @@ nv20_graph_create(struct drm_device *dev)
|
||||
break;
|
||||
default:
|
||||
NV_ERROR(dev, "PGRAPH: unknown chipset\n");
|
||||
kfree(pgraph);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user