From patchwork Thu May 3 13:36:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 49199 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fEEPT-0005L8-1p; Thu, 03 May 2018 13:36:35 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751317AbeECNgd (ORCPT + 1 other); Thu, 3 May 2018 09:36:33 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:34892 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544AbeECNgb (ORCPT ); Thu, 3 May 2018 09:36:31 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2F148617C; Thu, 3 May 2018 15:36:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1525354588; bh=D173Z3cPB86dAqDacldgYWgIigCeBmUoF7jy34U6y8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=WWGl6fU15mPabgsrIadDRf8Ayw7Kbio0fbQlwVN6DnJ7Qui+75x/qFcIo2+Zp1sxl VTz0emenuybNXBKGDhVVT7bKCJBUO0iIIvuqwvQIZMRXFSdCczOSlCgITt8R9yjt3z 00vRkvXSNsJ3ZwTu/4ASLOU27nnWTdBXH4rbONWw= From: Kieran Bingham To: Laurent Pinchart , linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, Kieran Bingham Subject: [PATCH v4 05/11] media: vsp1: Clean up DLM objects on error Date: Thu, 3 May 2018 14:36:16 +0100 Message-Id: X-Mailer: git-send-email 2.17.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Reviewed-by: Laurent Pinchart --- 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 b23e88cda49f..fbffbd407b29 100644 --- a/drivers/media/platform/vsp1/vsp1_dl.c +++ b/drivers/media/platform/vsp1/vsp1_dl.c @@ -851,8 +851,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); }