From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C45CBC00528 for ; Tue, 1 Aug 2023 14:12:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234286AbjHAOL7 (ORCPT ); Tue, 1 Aug 2023 10:11:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233860AbjHAOLt (ORCPT ); Tue, 1 Aug 2023 10:11:49 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EFA61FC6; Tue, 1 Aug 2023 07:11:36 -0700 (PDT) Received: from [192.168.88.20] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 736573D4; Tue, 1 Aug 2023 16:10:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1690899032; bh=rBE60NhSIBvoTv5ng/HCMVJEVsEqIi4yiM5H2RFTGik=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=CjBW4xhM4fLBxbi92WKxrnRrognf0Q0sJa4cFNLODTsVgppzxK92ksOx32HTO2yp6 MDdq2KcBk/iVwxlkziIPVGwGONVJbr2JqHTqcyE/ykMLv/pOxUlYd4pKU+l/CPmCCz gIN9fksoSRMYOuBOFTgQ0ljUmrsPcvsznBSOnxUI= Message-ID: <75af74a6-0b89-8a8b-d1d4-3ff2090aa530@ideasonboard.com> Date: Tue, 1 Aug 2023 17:11:31 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v8 06/16] media: cadence: csi2rx: Cleanup media entity properly Content-Language: en-US To: Jai Luthra , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mauro Carvalho Chehab , Maxime Ripard , niklas.soderlund+renesas@ragnatech.se, Benoit Parrot , Vaishnav Achath , Vignesh Raghavendra , nm@ti.com, devarsht@ti.com References: <20230731-upstream_csi-v8-0-fb7d3661c2c9@ti.com> <20230731-upstream_csi-v8-6-fb7d3661c2c9@ti.com> From: Tomi Valkeinen In-Reply-To: <20230731-upstream_csi-v8-6-fb7d3661c2c9@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/07/2023 11:29, Jai Luthra wrote: > From: Pratyush Yadav > > Call media_entity_cleanup() in probe error path and remove to make sure > the media entity is cleaned up properly. > > Suggested-by: Laurent Pinchart > Signed-off-by: Pratyush Yadav > Signed-off-by: Jai Luthra > Reviewed-by: Laurent Pinchart > --- > v7->v8: No change > > drivers/media/platform/cadence/cdns-csi2rx.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c > index fd6f2e04e77f..83d1fadd592b 100644 > --- a/drivers/media/platform/cadence/cdns-csi2rx.c > +++ b/drivers/media/platform/cadence/cdns-csi2rx.c > @@ -547,6 +547,7 @@ static int csi2rx_probe(struct platform_device *pdev) > err_cleanup: > v4l2_async_nf_unregister(&csi2rx->notifier); > v4l2_async_nf_cleanup(&csi2rx->notifier); > + media_entity_cleanup(&csi2rx->subdev.entity); > err_free_priv: > kfree(csi2rx); > return ret; > @@ -559,6 +560,7 @@ static void csi2rx_remove(struct platform_device *pdev) > v4l2_async_nf_unregister(&csi2rx->notifier); > v4l2_async_nf_cleanup(&csi2rx->notifier); > v4l2_async_unregister_subdev(&csi2rx->subdev); > + media_entity_cleanup(&csi2rx->subdev.entity); > kfree(csi2rx); > } > > Reviewed-by: Tomi Valkeinen Tomi