Messages in this thread |  | | From | "Zhuo, Qiuxu" <> | | Subject | RE: [PATCH v2] EDAC/altera: Fix SDMMC PortB OF node reference leak | | Date | Tue, 5 May 2026 03:29:27 +0000 |
| |
> 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>
|  |