From patchwork Thu Aug 20 09:21:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 265730 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15CB8C433DF for ; Thu, 20 Aug 2020 10:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D74F8206DA for ; Thu, 20 Aug 2020 10:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597918284; bh=lxe8g7FX23dHva9JYODgWaxoPdH/vB0tpCeu2DOon2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IAH6X5bRODLYDSnfk2VLD6SThzqH2oZ27YRCEl29FIwYeryJpz0OIfqeWl4BcNXFD Ndist9YYI4FVte/pCEowGHIVXPmCo9wcZctlxnV4sE/hJret/C38DFdsAmHrdxeVz3 J/I+95BJGMPbWSccH4ON4XzNqrXzCmPQXUXm+Hns= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730972AbgHTKLY (ORCPT ); Thu, 20 Aug 2020 06:11:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:50192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730966AbgHTKLX (ORCPT ); Thu, 20 Aug 2020 06:11:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B7AA2067C; Thu, 20 Aug 2020 10:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597918282; bh=lxe8g7FX23dHva9JYODgWaxoPdH/vB0tpCeu2DOon2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iq9J1bkTc0wpLAxdJWeIckCwBhACMyYlA1pCcYljGhX8IZBBYwcNFOv0OdnnKhAuf c6JM2tG5FCWdczgjzFtnG1CZ8c3yDSzmbcbqlRV6X7uezukFe8DBUuYCgiZ9+qn0FD i0K3XtX7vYDO5CneJcjli/P+raeRcQZTV+pZsHOE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuhong Yuan , Laurent Pinchart , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 088/228] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities() Date: Thu, 20 Aug 2020 11:21:03 +0200 Message-Id: <20200820091612.011597270@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091607.532711107@linuxfoundation.org> References: <20200820091607.532711107@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chuhong Yuan [ Upstream commit dc7690a73017e1236202022e26a6aa133f239c8c ] preview_init_entities() does not call v4l2_ctrl_handler_free() when it fails. Add the missed function to fix it. Fixes: de1135d44f4f ("[media] omap3isp: CCDC, preview engine and resizer") Signed-off-by: Chuhong Yuan Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/omap3isp/isppreview.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/omap3isp/isppreview.c b/drivers/media/platform/omap3isp/isppreview.c index e981eb2330f18..ac005ae4d21b4 100644 --- a/drivers/media/platform/omap3isp/isppreview.c +++ b/drivers/media/platform/omap3isp/isppreview.c @@ -2290,7 +2290,7 @@ static int preview_init_entities(struct isp_prev_device *prev) me->ops = &preview_media_ops; ret = media_entity_pads_init(me, PREV_PADS_NUM, pads); if (ret < 0) - return ret; + goto error_handler_free; preview_init_formats(sd, NULL); @@ -2323,6 +2323,8 @@ static int preview_init_entities(struct isp_prev_device *prev) omap3isp_video_cleanup(&prev->video_in); error_video_in: media_entity_cleanup(&prev->subdev.entity); +error_handler_free: + v4l2_ctrl_handler_free(&prev->ctrls); return ret; }