Re: [PATCH] mtd: intel-dg: Fix runtime PM error path in probe

Raag Jadav <[email protected]>
Newsgroups org.infradead.lists.linux-mtd,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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 <[email protected]>

Reviewed-by: Raag Jadav <[email protected]>

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.