Re: [PATCH] media: atomisp: Fix resource leak in atomisp_pci_probe()
From: Dawei Feng
Date: Mon Jun 08 2026 - 10:15:44 EST
Hi Dan,
On Mon, Jun 08, 2026 at 11:51:45 +0300, Dan Carpenter wrote:
> The code is buggy, but this isn't the right fix.
>
> Here is generally the standard way to do error handling.
> https://staticthinking.wordpress.com/2022/04/28/free-the-last-thing-style/
>
> 1. An allocation should clean up it's own partial allocations. That
> should not be handled in the caller. 2. Every allocation function should
> have a mirror cleanup function.
>
> The atomisp_uninitialize_modules() function is just a dummy and was never
> actually implemented. The correct thing is to implement it.
Thanks for the review and the link to the error handling guidelines.
Thanks for the pointer. I'll update it in v2.
Thanks,
Dawei