Re: [PATCH v3] EDAC/ie31200: Fix error handling in ie31200_register_mci
From: Luck, Tony
Date: Mon Nov 10 2025 - 20:33:31 EST
On Thu, Nov 06, 2025 at 04:47:35PM +0800, Ma Ke wrote:
> ie31200_register_mci() calls device_initialize() for priv->dev
> unconditionally. However, in the error path, put_device() is not
> called, leading to an imbalance. Similarly, in the unload path,
> put_device() is missing.
>
> Although edac_mc_free() eventually frees the memory, it does not
> release the device initialized by device_initialize(). For code
> readability and proper pairing of device_initialize()/put_device(),
> add put_device() calls in both error and unload paths.
>
> Found by code review.
>
> Signed-off-by: Ma Ke <make24@xxxxxxxxxxx>
Applied v3 version.
Thanks
-Tony