lkml.org 
[lkml]   [2026]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2] EDAC/altera: Fix SDMMC PortB OF node reference leak
Date
> From: Yuho Choi <dbgh9129@gmail.com>
> Sent: Monday, May 4, 2026 5:26 AM
> To: Dinh Nguyen <dinguyen@kernel.org>; Borislav Petkov <bp@alien8.de>;
> Luck, Tony <tony.luck@intel.com>
> Cc: linux-edac@vger.kernel.org; linux-kernel@vger.kernel.org; Yuho Choi
> <dbgh9129@gmail.com>
> Subject: [PATCH v2] EDAC/altera: Fix SDMMC PortB OF node reference leak
>
> of_find_compatible_node() returns a device node with its refcount
> incremented. altr_portb_setup() looks up the SDMMC ECC node but does not
> drop that reference on error paths or after successful setup.
>
> Route those exits through an of_node_put() cleanup path. Also free the EDAC
> control info if devres_open_group() fails after dci has been allocated, and
> release the devres group before freeing dci because altdev is stored in dci-
> >pvt_info.
>
> Fixes: 911049845d70 ("EDAC, altera: Add Arria10 SD-MMC EDAC support")
> Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
> ---
> Changes since v1:
> - Free the EDAC control info when devres_open_group() fails after dci
> has been allocated.
> - Release the PortB devres group before freeing dci so altdev->ddev
> remains valid during devres cleanup.
> - Keep the !dci failure path limited to dropping the OF node reference.
>
> drivers/edac/altera_edac.c | 17 ++++++++++++-----
> 1 file changed, 12 insertions(+), 5 deletions(-)


LGTM. Thanks.

Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>

\
 
 \ /
  Last update: 2026-05-05 05:30    [W:0.061 / U:2.349 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog