[PATCH] mtd: intel-dg: Fix runtime PM error path in probe
Raag Jadav
raag.jadav at intel.com
Tue Jul 7 00:57:47 PDT 2026
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 at gmail.com>
Reviewed-by: Raag Jadav <raag.jadav at intel.com>
More information about the linux-mtd
mailing list