Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1401013pxb; Fri, 21 Jan 2022 17:44:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyn92xYyxg8YLGotXCIOT7B9ET31Ig3y0rC0UP7PZta5HwEctLPKBvDAa0gCD7AYKT0HXj9 X-Received: by 2002:a17:902:da8a:b0:14b:370b:23fe with SMTP id j10-20020a170902da8a00b0014b370b23femr57825plx.103.1642815876970; Fri, 21 Jan 2022 17:44:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642815876; cv=none; d=google.com; s=arc-20160816; b=lEhgoJMoWYbZ7aNmPIMjpW0XKQbdXHyL/o/K7FocXrWeQ3Mp1vWcCNbBzIT/p81AUV 5IWJmC1JzVGhxKQMnOY9DHsVIZCZ5S8xgEdzfu8r5eTVRAct5322YbwE46BF568XgrhA jlJSdSBArEWBopizOo7QUidO6vb1xXkPZHaw6IowC+tETmIrke79jrIeiHQNXQSCQ31z hP3371kXWXrW4PEo07dKrrAjgYNX/9aXdwjd1GEI0dyvRXNyEHQwsbyzPffkVtuaFskG 8LgvgAVR9OMRKUYfAJ/Xw3Y4n0SJ36Vt3Y58WrPDMhUCQ/kxzUd7QhG/L+hz0n86WXOH ZT0w== 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=4I52waAt/NZ50wpuUl9NroPw6wNQWt/021RT2Y6RuUM=; b=yQ/iIvdWJKyuZ2hxxjdhmUKsIh7Aduyv/9Ku/cHCq9KARKhDs/RUhiujygHtH91iBt CYwgrklLGNDtndoZf7OIXCjNljtQ73/BSTCEVp06Xl/zibwu1w9TZpKaGHbyiHbbotZc NV58EiuSTT2DBZJ+GXvFyWtaSu8E1Ycr5rmqKSdvxPNzAWwGBle6+UyADQtcJzUfuK+m LSS0PKgSYQ2OeHAqOOn09GLuETSCctxasteyYQ7mXEcMy+FayOpbrUKDIDgTcLoi44zA 7m1fEdl4r2ko2duiqiiVNlz2SaaA8/4n/xKVvbfBTu5c2PT/acuxj+G+64fnCZzKF2rS bKwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CfZzFXMU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oj10si15481991pjb.39.2022.01.21.17.44.25; Fri, 21 Jan 2022 17:44:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CfZzFXMU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381175AbiAUO3y (ORCPT + 99 others); Fri, 21 Jan 2022 09:29:54 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:33448 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350832AbiAUO3Y (ORCPT ); Fri, 21 Jan 2022 09:29:24 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 20LETG3k034610; Fri, 21 Jan 2022 08:29:16 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1642775356; bh=4I52waAt/NZ50wpuUl9NroPw6wNQWt/021RT2Y6RuUM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=CfZzFXMURI1izJJbKXAkXrOzstVndSRf/OIz3FkllRnnHHOg+Vu45bpIz6jaxfcGI FwOmSsoX1yjJVvIKE3EjypVDwJEXW5ILSSbmmGAHe+0+ltQNFN5HNoC86H+fZMIMGa GPPrfu2uoz98KtequN4SfvWsstrdlivPiwjcSWCs= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 20LETGpX018594 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 21 Jan 2022 08:29:16 -0600 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Fri, 21 Jan 2022 08:29:16 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Fri, 21 Jan 2022 08:29:16 -0600 Received: from pratyush-4F-325.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 20LET4Hn072129; Fri, 21 Jan 2022 08:29:13 -0600 From: Pratyush Yadav To: Mauro Carvalho Chehab CC: Pratyush Yadav , Laurent Pinchart , Nikhil Devshatwar , Tomi Valkeinen , Benoit Parrot , Maxime Ripard , Rob Herring , Sakari Ailus , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , , , Subject: [PATCH v6 02/14] media: cadence: csi2rx: Cleanup media entity properly Date: Fri, 21 Jan 2022 19:58:52 +0530 Message-ID: <20220121142904.4091481-3-p.yadav@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220121142904.4091481-1-p.yadav@ti.com> References: <20220121142904.4091481-1-p.yadav@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Laurent Pinchart --- Changes in v6: - Add Laurent's R-by. Changes in v5: - New in v5. 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 2a23da6a0b8e..2547903f2e8e 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -471,6 +471,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; @@ -483,6 +484,7 @@ static int 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); return 0; -- 2.34.1