summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorKieran Bingham2018-08-03 13:37:24 +0200
committerMauro Carvalho Chehab2018-08-03 21:57:13 +0200
commit8a3a0797dedd39a6ee7a52c3749d31f8104aafa7 (patch)
treed76fac1a000e985af62dcb2b7828530201cec437 /drivers/media/platform
parentmedia: vsp1: Remove unused display list structure field (diff)
downloadkernel-qcow2-linux-8a3a0797dedd39a6ee7a52c3749d31f8104aafa7.tar.gz
kernel-qcow2-linux-8a3a0797dedd39a6ee7a52c3749d31f8104aafa7.tar.xz
kernel-qcow2-linux-8a3a0797dedd39a6ee7a52c3749d31f8104aafa7.zip
media: vsp1: Clean up DLM objects on error
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>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/vsp1/vsp1_dl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_dl.c b/drivers/media/platform/vsp1/vsp1_dl.c
index 199843a73df1..64e5b25d1123 100644
--- a/drivers/media/platform/vsp1/vsp1_dl.c
+++ b/drivers/media/platform/vsp1/vsp1_dl.c
@@ -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);
}