Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5823519rwb; Tue, 1 Aug 2023 08:21:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlE7UZ7D6GJgCKJdOgnlXOrqxV1+WlU6tdYBQ5vTTaXYPm2lUYFJJpUGOi2hlwj/k5ZqLgmX X-Received: by 2002:a05:6512:1592:b0:4fb:7b2a:78de with SMTP id bp18-20020a056512159200b004fb7b2a78demr3238188lfb.45.1690903289735; Tue, 01 Aug 2023 08:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690903289; cv=none; d=google.com; s=arc-20160816; b=hOSUo7IQVaIJhNhOk3adP7UpxtMz7NwIgF9ajH5cdVrF11j507LzUgNuvz554rJe0Z FBmRdwzAmwKjTQsPYQXrA7WiBXvmDRemIg40Qipa6DY2I0UjfcnL4+vKlZd+PnTTmxMg SwZdc2gjGj0cfjb13z0u7/14vGJ9rrwUCsZDYnVSc/wAw4+sFeW4NEg6vbOWgjndFqQw 5Zf41NeTzb2zHa0YM362hnfA/a+ZjAWX/UKrDHx5Km0WZx1QkVGb3Ap/TD6Mjo9Oo5f7 FSPFWALbmk41LeQdAxFyStjM4RrUi8l10I9tcevrl+dmcdKMFQ5MfcPxNl8ZWsyAoHD0 bmxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=sk6le4+O/nBkOS9Fo/8+g67w9OcdiJsdZVPlxvtLY0Y=; fh=LroA/i1EM0DOjWSTFbQc0E4XLyK+5NHY20upRsJ5XaQ=; b=D8iRbe3sCnG+vHUjZe55L+nNBWMoQ923a4a3w78quPT10FkzwLy8FZ/ZD/D4LxyUxg U4JuokbvvVMS82g99kTWwZRijP1DV/zLVH97nVin1g73dgc+GQumDOXIhFwDW+ijq5fo kGzriRBCSOb4F+bwB/cwXjllbO27gQx2bCXoEtZGu/yYjFVrwg/iOxqHJcCMuz4mkLhE sbcbgnyXzFJveJoEFfNYF7oI7QlcT73iEo5SuTfAzLV49O27hmMXCko8d6P/YMknRBVM 2MGfY15ZESrqs8p2Mvgorg8PCRFGOtHmVXOT+Fi8j73YPMjOULaYqVt3wRNlWJEw7K0E HGGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=CjBW4xhM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020aa7de85000000b00522ac23622dsi5860719edv.168.2023.08.01.08.21.03; Tue, 01 Aug 2023 08:21:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=CjBW4xhM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234173AbjHAOL7 (ORCPT + 99 others); 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 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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