Re: [PATCH] media: davinci: vpif: Fix memory leak in probe error path

From: Johan Hovold
Date: Mon Apr 14 2025 - 03:57:12 EST


On Fri, Apr 11, 2025 at 10:48:17PM +0300, Dmitry Nikiforov wrote:
> If an error occurs during the initialization of `pdev_display`,
> the allocated platform device `pdev_capture` is not released properly,
> leading to a memory leak.
>
> Fix this by adding `platform_device_del(pdev_capture)` in the error path.

Good catch, but you should fix up the error path above this one
(kzalloc) as part of this patch as well.

Johan