Thread (3 messages) 3 messages, 3 authors, 2025-12-11

Re: [PATCH] net: phy: mediatek: fix nvmem cell reference leak in mt798x_phy_calibration

From: Daniel Golle <daniel@makrotopia.org>
Date: 2025-12-11 11:05:56
Also in: linux-mediatek, lkml, netdev, stable

On Thu, Dec 11, 2025 at 12:13:13PM +0400, Miaoqian Lin wrote:
When nvmem_cell_read() fails in mt798x_phy_calibration(), the function
returns without calling nvmem_cell_put(), leaking the cell reference.

Move nvmem_cell_put() right after nvmem_cell_read() to ensure the cell
reference is always released regardless of the read result.

Found via static analysis and code review.

Fixes: 98c485eaf509 ("net: phy: add driver for MediaTek SoC built-in GE PHYs")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <redacted>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help