linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 05/11] media: vsp1: Clean up DLM objects on error
Date: Tue, 13 Mar 2018 19:05:21 +0100	[thread overview]
Message-ID: <0ae9f67a2dfb4e5268a968079def8da66c4b0d24.1520963956.git-series.kieran.bingham+renesas@ideasonboard.com> (raw)
In-Reply-To: <cover.89a4a5175efbf31441ba717a99b0e3c31088179f.1520963956.git-series.kieran.bingham+renesas@ideasonboard.com>
In-Reply-To: <cover.89a4a5175efbf31441ba717a99b0e3c31088179f.1520963956.git-series.kieran.bingham+renesas@ideasonboard.com>

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>
---
 drivers/media/platform/vsp1/vsp1_dl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/vsp1/vsp1_dl.c b/drivers/media/platform/vsp1/vsp1_dl.c
index 310ce81cd724..680eedb6fc9f 100644
--- a/drivers/media/platform/vsp1/vsp1_dl.c
+++ b/drivers/media/platform/vsp1/vsp1_dl.c
@@ -831,8 +831,10 @@ struct vsp1_dl_manager *vsp1_dlm_create(struct vsp1_device *vsp1,
 		struct vsp1_dl_list *dl;
 
 		dl = vsp1_dl_list_alloc(dlm, dlm->pool);
-		if (!dl)
+		if (!dl) {
+			vsp1_dlm_destroy(dlm);
 			return NULL;
+		}
 
 		list_add_tail(&dl->list, &dlm->free);
 	}
-- 
git-series 0.9.1

  parent reply	other threads:[~2018-03-13 18:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.89a4a5175efbf31441ba717a99b0e3c31088179f.1520963956.git-series.kieran.bingham+renesas@ideasonboard.com>
2018-03-13 18:05 ` [PATCH v2 01/11] media: vsp1: drm: Fix minor grammar error Kieran Bingham
2018-03-13 18:05 ` [PATCH v2 02/11] media: vsp1: Remove packed attributes from aligned structures Kieran Bingham
2018-03-14  8:21   ` Geert Uytterhoeven
2018-03-13 18:05 ` [PATCH v2 03/11] media: vsp1: Rename dl_child to dl_next Kieran Bingham
2018-03-13 18:05 ` [PATCH v2 04/11] media: vsp1: Remove unused display list structure field Kieran Bingham
2018-03-13 18:05 ` Kieran Bingham [this message]
2018-03-13 18:05 ` [PATCH v2 06/11] media: vsp1: Provide VSP1 feature helper macro Kieran Bingham
2018-03-13 18:05 ` [PATCH v2 07/11] media: vsp1: Use header display lists for all WPF outputs linked to the DU Kieran Bingham
2018-03-13 18:05 ` [PATCH v2 08/11] media: vsp1: Add support for extended display list headers Kieran Bingham
2018-03-13 18:05 ` [PATCH v2 09/11] media: vsp1: Provide support for extended command pools Kieran Bingham
2018-03-13 18:05 ` [PATCH v2 10/11] media: vsp1: Support Interlaced display pipelines Kieran Bingham
2018-03-13 18:05 ` [PATCH v2 11/11] drm: rcar-du: Support interlaced video output through vsp1 Kieran Bingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ae9f67a2dfb4e5268a968079def8da66c4b0d24.1520963956.git-series.kieran.bingham+renesas@ideasonboard.com \
    --to=kieran.bingham+renesas@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --subject='Re: [PATCH v2 05/11] media: vsp1: Clean up DLM objects on error' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).