From patchwork Mon Aug 17 15:15:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266219 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, 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 BB83CC433DF for ; Mon, 17 Aug 2020 18:21:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E92E20716 for ; Mon, 17 Aug 2020 18:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597688479; bh=uM7G/tatLBFS14JlVFv7iSDjzgprG2fc6lGpjvEMtXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HkImUFrumazhGoEUUBmVdiBtrw24sVQxyrfCPd2tgl1roH1WGY5b8StbJl+Hes++z WImGEHyJKV3f8P9jctdK+6+2BlbQtjtbXhreI6DSUq/UaGF8nCwjGslsm1U1aRad/R qJGqA5n+0cUzD2wCipmwI1f4Z+jCkghOISY0CS3Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390840AbgHQSVS (ORCPT ); Mon, 17 Aug 2020 14:21:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:51982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388289AbgHQQEP (ORCPT ); Mon, 17 Aug 2020 12:04:15 -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 E7AEE207FB; Mon, 17 Aug 2020 16:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680245; bh=uM7G/tatLBFS14JlVFv7iSDjzgprG2fc6lGpjvEMtXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nZjMvXQOzGBUCGTjc3txN9olFBYY5Y106tiXO58JQn7dS7YjMkoqTOopuJNp41MsW WU5W7WJkG3TCR4H8SZzsrtkSuT8+LYEWwzoYZQLxexM+AdZZ9TKrOyh9hU0x4SKnfT ZOck1Ifw4oeWVjcj5+2OuFTlAVUnFLqDAUK1ReIQ= 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 5.4 110/270] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities() Date: Mon, 17 Aug 2020 17:15:11 +0200 Message-Id: <20200817143801.264264134@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@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 97d660606d984..b8c2b8bba826e 100644 --- a/drivers/media/platform/omap3isp/isppreview.c +++ b/drivers/media/platform/omap3isp/isppreview.c @@ -2287,7 +2287,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); @@ -2320,6 +2320,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; }