RE: [PATCH] EDAC/i10nm: Fix mdev reference leak in i10nm_get_ddr_munits()
From: Leo Zhuo
Date: Wed Sep 16 2026 - 10:36:33 EST
> From: Wentao Liang <vulab@xxxxxxxxxxx>
> Sent: Wednesday, September 16, 2026 5:13 PM
> To: bp@xxxxxxxxx
> Cc: linux-edac@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> qiuxu.zhuo@xxxxxxxxx; tony.luck@xxxxxxxxx; Wentao Liang <vulab@xxxxxxxxxxx>;
> stable@xxxxxxxxxxxxxxx
> Subject: [PATCH] EDAC/i10nm: Fix mdev reference leak in i10nm_get_ddr_munits()
>
> External email: Use caution opening links or attachments
>
>
> In i10nm_get_ddr_munits(), get_ddr_munit() returns a PCI device with its reference
> count incremented. If ioremap() fails to map the MMIO space of the memory
> controller, the function returns -ENODEV without putting the reference held by
> mdev, leaking it.
>
> Put the device reference before returning on the ioremap failure path.
>
> Fixes: c545f5e41225 ("EDAC/i10nm: Skip the absent memory controllers")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
LGTM,
Reviewed-by: Qiuxu Zhuo <qzhuo@xxxxxxxxxx>
[...]