Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1884784rdb; Mon, 9 Oct 2023 06:12:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKTUzru0SXGz4WHV14P2NK1g/eEGdTjiFp+WMLWkkhOUmqY3LmEt3CWJ7QbeE2TvNQB1J0 X-Received: by 2002:a05:6a20:6a2b:b0:15a:7d2:a418 with SMTP id p43-20020a056a206a2b00b0015a07d2a418mr17410367pzk.19.1696857122861; Mon, 09 Oct 2023 06:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696857122; cv=none; d=google.com; s=arc-20160816; b=vDjn/5fcc7X2/SxFWDCihqTV4q6n3IG3GRIeOBnffHKisGtLyCECG7j/vnqXJRF1BV HVFTp5IkKUviRMmxrrUo8oHGt0pXs8X+NicQCjVGlfcMhmXQ2ENTie7/X/fLBaHlpRzv IacA4T/F96fAwQ9c3gaTO7OYhPgZcIPINvKzENsOtSDrlcfzpvA+B4DTL8xsw9Tefn0R Ezgp2vg8sLdN/HdYM71Opk3ypHXK1iWdhRUYAZUkPhwf94s3inQHRvI1nBvxzuHrZvsa osqT5BtF3vWT4D2P0doieuNn+8zymALmc3v3/2RlEBHx8Z3byxZ45vst5vENXJ9ugOex edbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CV36wgcU/HLXBVGVMd9iVHL8DT1YkN+Xfgsfa3xX9x8=; fh=6xb4dRkd2+1fqSC803o7QgwwC4DGCN1bJaIcF3oxTbc=; b=UyizyhsMaOQuQSSlTjTm/bX8J5l/wzgptGhQ02+YGAGtX0AomgFw5ZzEIiv+X4S5pN LTnt3LaCvdNDOTEKQNAlP9HZp0mbascwWzyE5T1mS2njQxKWtAVKNUBlVqkHT70hDb2O TKOPilP7F/Z6knkSz3NmEkm5LHwFEPwOfJTWvxBqWcQPln/oN8bdD7SrK7EXob4UhdzA IKht99iUZp79tQyfyy2zrAt3dN6pC4+8Dhf2p0f1BlxWLk1iY2s8XpuygjpWXP5gv3QW DHt/ctV51kxJNNCwyPPp9j6273YrxVT2jWnCMykMQroAy6oJu50sfuyYYOeEZzrk87XU bekg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=dgsaxSEc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id z1-20020a63c041000000b00563d9ff5157si9279113pgi.547.2023.10.09.06.12.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 06:12:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=dgsaxSEc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E82FD8086502; Mon, 9 Oct 2023 06:10:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376880AbjJINKb (ORCPT + 99 others); Mon, 9 Oct 2023 09:10:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376809AbjJINKL (ORCPT ); Mon, 9 Oct 2023 09:10:11 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5835DB6; Mon, 9 Oct 2023 06:10:08 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 399D9lqO067927; Mon, 9 Oct 2023 08:09:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1696856987; bh=CV36wgcU/HLXBVGVMd9iVHL8DT1YkN+Xfgsfa3xX9x8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=dgsaxSEcdcpN2PjibxRa5+3ngC9mQETVpIYjtI+VVe9/jWrIPo+Lr0OwWLOOmvRqX EpDDo6fRYFV/QywxLGfk9wM0ONP4bs9ozsxAHcaJQdoc1QF95jZeg/u1JvJrEUh7pd WNDeLdofh2jANhlHyx3gVuz0HGfcXPCa7N5Q8dAI= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 399D9lq9071516 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Oct 2023 08:09:47 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 9 Oct 2023 08:09:47 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 9 Oct 2023 08:09:47 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 399D9kYZ007220; Mon, 9 Oct 2023 08:09:47 -0500 From: Jai Luthra To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Tomi Valkeinen CC: , , , , Laurent Pinchart , Mauro Carvalho Chehab , Maxime Ripard , , Benoit Parrot , Vaishnav Achath , Vignesh Raghavendra , , , , , Martyn Welch , Julien Massot Subject: [PATCH v10 04/13] media: cadence: csi2rx: Cleanup media entity properly Date: Mon, 9 Oct 2023 18:39:30 +0530 Message-ID: <20231009-upstream_csi-v10-4-330aaed24c5d@ti.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009-upstream_csi-v10-0-330aaed24c5d@ti.com> References: <20231009-upstream_csi-v10-0-330aaed24c5d@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1450; i=j-luthra@ti.com; h=from:subject:message-id; bh=H/tqA+nD3NGE1eGbYGM3sFZkNgmvZBDs5F3fkDcglS8=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBlI/soM+r1Abx3POL55vGgtgNp8ipGOuaEErKcS St/el2ZgeeJAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZSP7KAAKCRBD3pH5JJpx RQiWD/0Vi/7XZI+N67WWGCQ2/h8GgvfJLjRiLzj0TTUoBt1A6QgXcZD7scqg31TGrTbrIHPAvx8 rHnaz6ZKE/1p9BxitVGsgVuIxEsXlZSspJA3lsGiHOCvnxkiFkrLLO68iYqcjdAcr2tvfOjrZye HmZW25ueDRVmFpRlfqvP5JLvMHCX6h1QKncIO0ZileirmvVsKC1bbpFz7LdVGE1uOIiH2v5o/WK hupzvamqUp6f1c0+3QgaIUxetYw9hr39tQNh2svBCpgbtwHPxyYPYwE7l2woM92WaWjw3JVBm5/ wcFMdAToIGgqCVIxXUouEUrxjPhkJxyfO3f55LoidBnEsV4yT8whrjNf2YFTpfiakk+zt0mT3cR JGQS4vRVUw3E0ss6l/PIk83iHRmSlcXj4k3xzTJ8t1s0wyA0Cjd3cbkXSaOTRibhAskP3h3iBNW VZUilDN62HRBEKDYfLLRm6C0tdSgzwjHKxD4D0vkl7QGqRH5QKCy38UW/n21cx9TR5k3qSrgjrp ZP57OQkacsQlqJsAXf/ebltO4mvPZyWJz35/HM6T43Ixjz90SNv0zR4GrsGcUsoxONRjScw0UeD e/I5eBEexLppIqhII1F0tm0JgvoarWnGiJN4Aw760Rfr6mhtc0BIfaRC9vD9uvvcVKTfL9hcMIn subRbnDwSZS9pvQ== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 09 Oct 2023 06:10:58 -0700 (PDT) X-Spam-Level: ** 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 Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Signed-off-by: Jai Luthra --- 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 64e472ca3594..399b2f800dc4 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); } -- 2.42.0