From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF3972E8DEF; Wed, 8 Jul 2026 15:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783526082; cv=none; b=jyD4a5VXxtf1iheyq1YwqIPaodlLgJmXWA2Zc8lpBq2ms2b3Kd8zYWPI3EJxaC25xfv4OdbroEx3Fzll3Vwkod8Ucwpt5Yqj6ekqTb6y04by8MD/BRnyT1ZrxiHu/FrhI+y+TA9AH6dw85Hj24hyTarWGQn83YqnjyaUNsA5hHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783526082; c=relaxed/simple; bh=AKhQhkQO9Lc61foB1icnluYqTshu7kNM9DJSZMtmXn0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZlezfhZgUllBt8QjOMnGH0WSlgU/1qRKEO9hYGclImm4Cw7UGbYyR5HqX4QvcW4f3rzzVY8vh+W79gG9HX9WGQ75r/BnWT49nkeSsCrEf0s+1F4o7iI/DRROIn9TjukT/fwAu5iI3WsDHbMD5bOQduOhiBaveNcqahBAwC7hB1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=hr0g/akI; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="hr0g/akI" Received: from ideasonboard.com (93-46-82-201.ip106.fastwebnet.it [93.46.82.201]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 30FAFEAA; Wed, 8 Jul 2026 17:53:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1783526027; bh=AKhQhkQO9Lc61foB1icnluYqTshu7kNM9DJSZMtmXn0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hr0g/akIpTD/Aspu4h/P7tO0Z3EFMWDizCAlHckYz4u6eAVpEhnIZBXerZ9ci0Z8h MUkxVFiWyVcOOkpEkP0GqxDQmyHbcDb9ZplW1mJIu946oNLQTGGWNXkI24L6v0m38F Hz8afrBasKgfyrZATmYftHcVGuGn4Wk3f59DW5Rc= Date: Wed, 8 Jul 2026 17:54:34 +0200 From: Jacopo Mondi To: Biren Pandya Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, niklas.soderlund@ragnatech.se, mchehab@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com, jacopo.mondi@ideasonboard.com Subject: Re: [PATCH v3 2/4] media: renesas: csisp: Add missing media_entity_cleanup() Message-ID: References: <20260704174638.66302-6-birenpandya@gmail.com> <20260704174638.66302-8-birenpandya@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260704174638.66302-8-birenpandya@gmail.com> Hi Biren On Sat, Jul 04, 2026 at 11:16:41PM +0530, Biren Pandya wrote: > The probe error path and the remove function fail to call > media_entity_cleanup() upon teardown. > > While currently a no-op in most cases, 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. Furthermore, introduce a > dedicated error_entity label in the probe error path to ensure the cleanup > is only invoked if media_entity_pads_init() has successfully completed. Empty line please It could be added when applying though > Signed-off-by: Biren Pandya > --- > drivers/media/platform/renesas/rcar-isp/csisp.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/renesas/rcar-isp/csisp.c b/drivers/media/platform/renesas/rcar-isp/csisp.c > index 8fb2cc3b5650..61558a71ee35 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,8 @@ 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 +571,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); Reviewed-by: Jacopo Mondi Thanks j > > pm_runtime_disable(&pdev->dev); > } > -- > 2.50.1 (Apple Git-155) > >