From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 8DC964BC003 for ; Wed, 8 Jul 2026 17:09:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783530545; cv=none; b=a2Nk/gzH5Dmdyl+PHdRHLVb62qz1apXE0Y2gXRhrKLSjBeVwBryusZ88G9z1GX8y/TbJC9JFfmdGgzPa/SbxreQQb5VIm2oZw/8OFy/rsP4zOnzKREgMsgdWqXmUkd4RIrngvH7STQ/969LegZZFlinExR9v/bRFJ+gz7/gdgVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783530545; c=relaxed/simple; bh=rXJvQMnSWQxobBun6vz3L+Ik111O0wnn/SkTaHJJElM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LnOgIE6Xw1rbeC0JoWztCgcfD3m9BbRJM16TkC/uVpyO/jcuDQo9A9oJOYUVnxl7KFYBC1011YTWc8mY6Br+e/Qyn56MdE/fDvBnoPosbOW6qrfDSri/K+PZrh9hD/74+xGRv7li5rT+lm6YDCmc3gL6EWbdc6dflowZBGF2drs= 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=pg/+X1vK; arc=none smtp.client-ip=209.85.215.178 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="pg/+X1vK" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-c85b73ffb52so585078a12.3 for ; Wed, 08 Jul 2026 10:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783530542; x=1784135342; 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=ULPGWoabWt4C2dncnPEuY9DeqKuYkLPNtOiVYZB2zC4=; b=pg/+X1vK9QR0/4cvaNV/ZR2SUID5uDcuK7sgrUFOTFfTYCpHRYhR8l3Fa00sp2qFqk WrHm1FLFIRFNpPWxXXP6KVz2AWk4iYjDUZ8rE7HfhekILYYF2xrbhaJL6PlK5znYkKX4 thU6TspORuMXcCMxJF4OG8UwVaQmN+NcaV9X27HgoZoRR3Z60pXtc2AbVWiBUYc7PCQl On/GWe78LSMPUyyGmvkZDDTGjni7L69P4mZy0/RUbDW5iaQksxVa9USHjSljnCnPKBy4 QLQqBPDGRPbr1kE7nWE+DeFZgiKfztt6l3IJmRB9t2tiTHa/QPC2vE8pV/1zpu9QH0h0 /D6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783530542; x=1784135342; 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=ULPGWoabWt4C2dncnPEuY9DeqKuYkLPNtOiVYZB2zC4=; b=C31Qo7cUG8C/0sUOWS3qHLoPyrLeGoTWMR06McsRWy0+wzjDs790tvvI2AFdGPdKgz MQC1W4+pGfshq4hO/dQGeG8FFBAB0xOUxfxiRzIfoUKEo7RaO/wne8Ky4mILWjE2oXBU HgRhc80++tfQJxK/H5OiOIR5GgtOlNjtn1IWQjjHwKhi7TZLxeQ/6LP5svOfLhvHS03A L7Cp15f3WRTvlfub5fxOLmqzAQBHQuDoTQFvV2szzhLY6cwCVmyI0ft8bOBiiRic/FMp eDm2u/xwf+PidN+9CbktuDDSXnLZSxw+9BrBHL8j5DKyyd4naBKdNqzpYoHfScGm+l23 R2CQ== X-Forwarded-Encrypted: i=1; AHgh+Ro6w4LClAm2t6w42lsZie+/qRGiVMYTEaeYfp+vmmI7jl5ucvseqtv/1VKXsnKXSMMSY9d3WvBEKqRQQtE=@vger.kernel.org X-Gm-Message-State: AOJu0YxwuXgvnKB+OwEkbYW14qtEF2/1T4aCjpakLT0rJ4Me/WXYZNGf Smss5w65AiUBKfA8Ienfh+TEFXCyqqJ/2pdpe8DGwIoT4BCDrLLBlVNX X-Gm-Gg: AfdE7cnXSleg7jcD67L9IPej53gQALCe9pOrK+8IlBK52dSguZcsDZ1BMJtDBFPKw/I t836iEVtghw7mznT2iUAke8ng3gxnypjtCra7RC593r0WuBhQoSVXHV6ZAtW/ckrqrJjAHWiyNV AWcGNIDQSD50kAHwTGZVxgf1f8hNyioTBT4x6Q69z0YqCg3lhjRMkUNaXd4HETuctIGUgiwxFQT INwyPb8CWIkwnkoGAUEIFgSWI7vmIKScupazGtxw1JvuJpAHhWlJHLcO8NfF9tBsaSMtb223aYe Kj7gDwxUCzVTHMuYkVD7ZEowr6xtcnyKsOcoiqa8IbT2C++Id9DdvZFV9CBdDcmAs5FICD11E5H 6IdW2gY/YjH+U1WJp4pG8sEBRmkStepfsb67IMgyzVK6ktrnh298XpeXIfL8QcYdS0E6ovJy10x iWnaNG2/mLlQhYAT1d4qOiA0Dg66t7JBqiNXEZ9ekak4s= X-Received: by 2002:a05:6a21:4e02:b0:3bf:c126:bb02 with SMTP id adf61e73a8af0-3c0bd0f8fdemr3778858637.47.1783530541999; Wed, 08 Jul 2026 10:09:01 -0700 (PDT) Received: from localhost.localdomain ([49.207.223.101]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13b659666e7sm26602154c88.7.2026.07.08.10.08.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 Jul 2026 10:09:01 -0700 (PDT) From: Biren Pandya To: niklas.soderlund@ragnatech.se, mchehab@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, Laurent Pinchart , Jacopo Mondi , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Biren Pandya Subject: [PATCH v5 2/4] media: renesas: csisp: Add missing media_entity_cleanup() Date: Wed, 8 Jul 2026 22:38:46 +0530 Message-ID: <20260708170843.55076-8-birenpandya@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260708170843.55076-6-birenpandya@gmail.com> References: <20260708170843.55076-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 path and 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 a dedicated error_entity label so the cleanup is only invoked when media_entity_pads_init() has actually succeeded. This ensures that the teardown logic properly mirrors initialization. Signed-off-by: Biren Pandya Reviewed-by: Jacopo Mondi --- drivers/media/platform/renesas/rcar-isp/csisp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/renesas/rcar-isp/csisp.c b/drivers/media/platform/renesas/rcar-isp/csisp.c index 8fb2cc3b56503..199b70ea841d9 100644 --- a/drivers/media/platform/renesas/rcar-isp/csisp.c +++ b/drivers/media/platform/renesas/rcar-isp/csisp.c @@ -539,7 +539,7 @@ static int risp_probe(struct platform_device *pdev) ret = v4l2_subdev_init_finalize(&isp->subdev); if (ret) - goto error_notifier; + goto error_entity; ret = v4l2_async_register_subdev(&isp->subdev); if (ret < 0) @@ -551,6 +551,9 @@ static int risp_probe(struct platform_device *pdev) error_subdev: v4l2_subdev_cleanup(&isp->subdev); +error_entity: + media_entity_cleanup(&isp->subdev.entity); + error_notifier: v4l2_async_nf_unregister(&isp->notifier); v4l2_async_nf_cleanup(&isp->notifier); @@ -569,6 +572,7 @@ static void risp_remove(struct platform_device *pdev) v4l2_async_unregister_subdev(&isp->subdev); v4l2_subdev_cleanup(&isp->subdev); + media_entity_cleanup(&isp->subdev.entity); pm_runtime_disable(&pdev->dev); } -- 2.50.1 (Apple Git-155)