From patchwork Tue Mar 14 11:55:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishnav Achath X-Patchwork-Id: 69536 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1719143wrd; Tue, 14 Mar 2023 05:12:54 -0700 (PDT) X-Google-Smtp-Source: AK7set9pVyUBQiPDrnueziPrA7tB7mcUGFyqfpaiQou+iMXlDsO2LIy8uVpS3//OHqiTlQofQieP X-Received: by 2002:a17:903:481:b0:1a0:5bb1:3f15 with SMTP id jj1-20020a170903048100b001a05bb13f15mr3408934plb.69.1678795974414; Tue, 14 Mar 2023 05:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678795974; cv=none; d=google.com; s=arc-20160816; b=c0EGOEMuI+eWZXX0x/Z+0bSlyFzRe3kV0yhFUuK7CX4TWBJx8nzvs5KXVOhaoDE4Bn 5AQF4F4rG3U7nUPPsW8Zs25mWMXVHzHK6tAl58WWPkuWf9qGalrR7UVLRo+y5ywUE3Dd kaqJH3W020NsMsGSQ1/fHbkOqmxEB36+Hipxxmrv1K805wGbn1PwZAk7BlQAefFpj22V BShKO1+565COjFLJsPEYZwFq2Za+nZloi6tkzW7TbEBUYCTfPFfdPVq9HqqzzZsEjn/g G+UtBq+vnWPhtFhmWdxpfQTc3CXTzDTW8OE+SH0FjhDgSbHbsqRmCoLuSKzhBASxJXV2 841A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=WlYyHV2rscE3JvYAKhJpMK+zPp8qksypOpo3lqWNjEM=; b=q7IPM8A1031RVa1tiVM1Cv2qtrqBS62jiAcp1LReHI8Gd1bNHhwPsEw2pccYFFBYWb muyNQhLLHoF6WRTp0jmyMwHlELGrwPeNKdX8nEmT9tsOn4/UmkrY0iAUtFsxyVZkSDuC VVZsOXFL2pHvuRQBN7Q51xuYtP2855geQKUZ5n+bzLdwimjJolMZmxF3z+u0jllzLMRf 6XrlJrgSk8XEpiKxFWyOQsSoxltqj96MVorQmhpvL1/+tTL3XP5fSEGfi+5vX0NHc+8p 2/yQPEBpa2qI8NmJda5TMi7SUdZIMOH6ziMTCF64R8Q4m4ladH+UAIRC6p2k/X7ZD/Zo xcZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=u1AGv+iq; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n14-20020a63590e000000b004df43225600si1984352pgb.709.2023.03.14.05.12.39; Tue, 14 Mar 2023 05:12:54 -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 header.i=@ti.com header.s=ti-com-17Q1 header.b=u1AGv+iq; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231582AbjCNLzz (ORCPT + 99 others); Tue, 14 Mar 2023 07:55:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231536AbjCNLzs (ORCPT ); Tue, 14 Mar 2023 07:55:48 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07CDA89F27; Tue, 14 Mar 2023 04:55:45 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 32EBtNLR105613; Tue, 14 Mar 2023 06:55:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678794923; bh=WlYyHV2rscE3JvYAKhJpMK+zPp8qksypOpo3lqWNjEM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=u1AGv+iq/1lehFNWh1VRk0FsEejdUXrvBaljru6KlqEkJb9hwryOeWZPgArm0zPdh DlaPa64UtMxhn6JhXDdU9VNEe713/XXkYd+KHBz14v3MlRNUZ7XPDFS9RL4Rayin8E TI7QfUfF2xhsGiAARTbEgJ5W04z93kNsuLmtGGKk= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 32EBtN5R002951 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 14 Mar 2023 06:55:23 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 14 Mar 2023 06:55:22 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 14 Mar 2023 06:55:22 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 32EBtLh0057098; Tue, 14 Mar 2023 06:55:22 -0500 From: Vaishnav Achath To: , , , , , , , , CC: , , , , , , , , , , Subject: [PATCH v7 02/13] media: cadence: csi2rx: Cleanup media entity properly Date: Tue, 14 Mar 2023 17:25:05 +0530 Message-ID: <20230314115516.667-3-vaishnav.a@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230314115516.667-1-vaishnav.a@ti.com> References: <20230314115516.667-1-vaishnav.a@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760345167516331140?= X-GMAIL-MSGID: =?utf-8?q?1760345167516331140?= 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: Vaishnav Achath Reviewed-by: Laurent Pinchart --- (no changes since v6) 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;