mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-08 20:59:07 +02:00
freedreno/msm/: check memory allocation in handle_stateobj_relocs
Signed-off-by: ganjing <ganjing@uniontech.com>
This commit is contained in:
parent
77687f8d6e
commit
e9d9e5c1ee
1 changed files with 5 additions and 0 deletions
|
|
@ -420,6 +420,11 @@ handle_stateobj_relocs(struct fd_ringbuffer *parent, struct fd_ringbuffer *state
|
|||
{
|
||||
struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(stateobj);
|
||||
struct drm_msm_gem_submit_reloc *relocs = malloc(nr_relocs * sizeof(*relocs));
|
||||
if (!relocs) {
|
||||
ERROR_MSG("malloc relocs failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < nr_relocs; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue