From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED53F3FF883 for ; Thu, 9 Jul 2026 09:18:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783588711; cv=none; b=HDG1GMIkkW7Tt5tU5QoxFVC1NGYng/tMGmRj7ul9xH1e54JKSHME8F4oN6GeYXdbYNRaN62QwHkGxtquf27ikcJeGOUaUVKLdMfMQI5EQNhqnXzwPGgfKt3jeNi9kxfQJaTZHTOGTyGpRUoaXpur1npVxpSpRl/wOlIvgu6rc60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783588711; c=relaxed/simple; bh=2oYX8Ngqt8P13rm04Gkrm4P8lT9wrX8RtglJxUz8wZ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I4JaCcNpInlrZSKYS+9/w259WQav2+R2VrWRTBHvWu6ZmgirCDabbZ6O1K1v8p7js1AVHtz9HwYpBrPP8K18McGbfsM24hT0pVu1KylV8ECQwUqoU98dNGP4tTYv3mwblrAMLycGIPwpGFA4gQMljZmZkIsLnhRg3liXELknnGM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CgozJNug; arc=none smtp.client-ip=209.85.215.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CgozJNug" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-c8894387780so952973a12.2 for ; Thu, 09 Jul 2026 02:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783588707; x=1784193507; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=2VIdnZJ14k+mj5oiEmsN8IAS641M6dsRWUzvfQqf2tY=; b=CgozJNug53yfzLAY/uUI0Y3MqXzLCEFZh/xxNxVpxNNi0uf5MuxD/7kzkxX6TIsViw 63HNWL3r1ieovo80zfXJLQM1NKl+STij0VB5KUi3P1cb0akH4eyK9hFC8zSfpNoElyfR lBh9OY4TQnunLLXJAciij7zaDXPxO0z1O3EsvS46I2SbrESJMdBkYvNWpQs7FTY787Cz Plf2L8yhlQz4mw3ZmT6uJnJ/WyU3cp4ccyoDfESswVhuwSLHijiEMIGbaeAHsDHJjiqv vyfwTI969oZfyCeUeLAPxMCkapjOc1QDdrDPf2NuV9gTUepEhgISkZ//MfWGtkfVzOdM Cf/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783588707; x=1784193507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=2VIdnZJ14k+mj5oiEmsN8IAS641M6dsRWUzvfQqf2tY=; b=ZyCgkMpeIQkRRvNUdAlFkBZP536/Jo7DFzGmDzomoahia58TvtjYdV5hFEt+6nGyKW Pd5nQa0vLytrm68vGkWag3FMMqhoTvsLntmM941Yih7T2zDQ8H3cHsgkYW9EeITT4ZQC s4vd+tEFAZtGKYvBxhxIdbOlRO9GW5PVcbnwYQdk5FguM1HN2A4zZZnPkKo2aH+XetSQ ITjUS+6Oy3lxgz0+l2Y7vPQTuEAfL3/i07mTJUTGJkcLNoRxg03KoQ6E/7yOWagpNhcM t1YlIPkvGmjtBddqYbTB6E3yefDgHGxqnka2xUiReDJT3+fGe1RDpS6fSFBRwYiLLGrO mcOQ== X-Forwarded-Encrypted: i=1; AHgh+RpbMgxomjdav2fsVBttAdYxWUG3egPvmgq5xXXxxUhqPAOyVRqsjVncdCgizGhKqxsLkfe5xBoMf+D2CvI=@vger.kernel.org X-Gm-Message-State: AOJu0YwNVLgWf+nQZ4fzdJAgiGBjBgAFsMR0i+4q9ZsEmZGlSnwmKtSw x5CDnwHEZL+rDH6+5O/4qHAkhgohUi09JbkwUHKnhj49wu2GEnp+zt8XCpXIFpg9 X-Gm-Gg: AfdE7cnsggC9YEnH6zrhWnCTjir5YPZeXFn474s9Ap0dORA3/pTxtAWKWLoC98YL4xi JALOuuSt2I0n25p78cVP2DYwZKviPaq2MGjvfHzTLPJNVW8cqVR66TzGMP5w6crHGsiNseqMwUM hwfb63t3rwGjFRoB9RNss3OFN0CoDnnOeon/Pd2D56l8u+DzrlluOItvNN9ysMxiSf/fXEFxIny l2Q6Bq9qHWOODFBnJCgoWxGKZdE50tuOOOOfMOyXXFg+Vi5sWzB+3kVPq/mvcXlraoyLETqo1XY RLDCMg46/rog54VaF/1sRL3eNIBLm7KySEzOl0u0FQQlNdhQ97eprdAZEmwAKGu3XvcK787Pc/S La2AErd8P1WaF7qdfL5ni+lylFQYUReZuS8e2nT+yNmvjhw872pMvQfsyOSU1iDwr7Hrg1dw1iI HAMzBMxuQy/yn9p9svpPaIVIjXdOTYvD6Sn8+YDURyI/Q= X-Received: by 2002:a05:6a21:490d:b0:3bf:ab4b:2d34 with SMTP id adf61e73a8af0-3c0bd1ed9cbmr7288188637.53.1783588706771; Thu, 09 Jul 2026 02:18:26 -0700 (PDT) Received: from localhost.localdomain ([49.207.223.101]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13b6594f6a9sm29682728c88.5.2026.07.09.02.18.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 09 Jul 2026 02:18:26 -0700 (PDT) From: Biren Pandya To: niklas.soderlund@ragnatech.se, mchehab@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jacopo.mondi+renesas@ideasonboard.com, Biren Pandya Subject: [PATCH v6 1/4] media: renesas: rcar-csi2: Add missing media_entity_cleanup() Date: Thu, 9 Jul 2026 14:48:15 +0530 Message-ID: <20260709091813.67081-7-birenpandya@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260709091813.67081-6-birenpandya@gmail.com> References: <20260709091813.67081-6-birenpandya@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The probe error paths and the remove function fail to call media_entity_cleanup() upon teardown. While currently a no-op, calling media_entity_cleanup() is an API requirement for entities initialized with media_entity_pads_init() to prevent memory leaks. Add the missing media_entity_cleanup() calls. Signed-off-by: Biren Pandya Reviewed-by: Jacopo Mondi --- drivers/media/platform/renesas/rcar-csi2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c index 7305cc4a04cb1..f9c818b0faf7e 100644 --- a/drivers/media/platform/renesas/rcar-csi2.c +++ b/drivers/media/platform/renesas/rcar-csi2.c @@ -2631,6 +2631,7 @@ static int rcsi2_probe(struct platform_device *pdev) v4l2_subdev_cleanup(&priv->subdev); error_pm_runtime: pm_runtime_disable(&pdev->dev); + media_entity_cleanup(&priv->subdev.entity); error_async: v4l2_async_nf_unregister(&priv->notifier); v4l2_async_nf_cleanup(&priv->notifier); @@ -2646,6 +2647,7 @@ static void rcsi2_remove(struct platform_device *pdev) v4l2_async_nf_cleanup(&priv->notifier); v4l2_async_unregister_subdev(&priv->subdev); v4l2_subdev_cleanup(&priv->subdev); + media_entity_cleanup(&priv->subdev.entity); pm_runtime_disable(&pdev->dev); } -- 2.50.1 (Apple Git-155)