[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251106113436.GAaQyHzGJfszVtHNU0@fat_crate.local>
Date: Thu, 6 Nov 2025 12:34:36 +0100
From: Borislav Petkov <bp@...en8.de>
To: tony.luck@...el.com
Cc: Ma Ke <make24@...as.ac.cn>, jbaron@...mai.com, qiuxu.zhuo@...el.com,
linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org
Subject: Re: [PATCH v3] EDAC/ie31200: Fix error handling in
ie31200_register_mci
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@...as.ac.cn>
> ---
> Changes in v3:
> - moved put_device() from fail_free to fail_unmap to avoid using uninitialized priv variable when window allocation fails.
Zapped v2 from the tree for the time being.
> Changes in v2:
> - modified the patch, thanks for developer's suggestions;
> - removed Fixes line.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists