Re: [PATCH] mtd: intel-dg: Fix runtime PM error path in probe
From: Raag Jadav
Date: Tue Jul 07 2026 - 03:57:58 EST
On Sun, Jul 05, 2026 at 11:31:07AM +0800, Guangshuo Li wrote:
> intel_dg_mtd_probe() allocates region names before enabling runtime PM
> and before calling pm_runtime_resume_and_get().
>
> If kasprintf() fails while building a region name, the error path jumps
> to err, which calls pm_runtime_put(). At that point there has not been a
> successful pm_runtime_resume_and_get() call to balance, so the runtime PM
> usage count can underflow.
>
> Jump to err_norpm from the kasprintf() failure path, as the runtime PM
> reference has not been acquired yet.
>
> Fixes: 779c59274d03 ("mtd: intel-dg: Fix accessing regions before setting nregions")
> Signed-off-by: Guangshuo Li <lgs201920130244@xxxxxxxxx>
Reviewed-by: Raag Jadav <raag.jadav@xxxxxxxxx>