Re: [PATCH 1/2] phy: sunplus: don't read the disc_vol cell after nvmem_cell_get() fails

From: Manivannan Sadhasivam

Date: Fri Nov 27 2026 - 09:12:31 EST


On 2026-11-16 09:40 +0200, Andrew Gaylard wrote:
> update_disc_vol() returns early only when nvmem_cell_get() gives
> -EPROBE_DEFER. On any other error, such as -ENOENT for a device tree
> without a disc_vol cell, it passes the error pointer to
> nvmem_cell_read() and nvmem_cell_put(), which dereference it.
>
> Use the default disconnect-voltage level on these errors, as the function
> already does when the read fails. nvmem_cell_get() never returns NULL,
> so IS_ERR() is enough.
>
> Tested on a Tibbo LTPP3G2 board.
>
> Fixes: 99d9ccd97385 ("phy: usb: Add USB2.0 phy driver for Sunplus SP7021")
> Signed-off-by: Andrew Gaylard <ag@xxxxxxxxxxxx>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>

- Mani