Skip to content

Commit

Permalink
media: vsp1: Clean up DLM objects on error
Browse files Browse the repository at this point in the history
If there is an error allocating a display list within a DLM object
the existing display lists are not free'd, and neither is the DL body
pool.

Use the existing vsp1_dlm_destroy() function to clean up on error.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Kieran Bingham authored and Mauro Carvalho Chehab committed Aug 3, 2018
1 parent b6ee44d commit 8a3a079
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/platform/vsp1/vsp1_dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,10 @@ struct vsp1_dl_manager *vsp1_dlm_create(struct vsp1_device *vsp1,
struct vsp1_dl_list *dl;

dl = vsp1_dl_list_alloc(dlm);
if (!dl)
if (!dl) {
vsp1_dlm_destroy(dlm);
return NULL;
}

list_add_tail(&dl->list, &dlm->free);
}
Expand Down

0 comments on commit 8a3a079

Please sign in to comment.