From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67B8D2F0661 for ; Tue, 7 Jul 2026 07:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783411074; cv=none; b=CeF7mTkqp0w2iQtX7RrObV4vVxgCUnb8W9gUE/F86H7R3xS6vc6qyKQKagoY5++VGqdhfBa03xWU/4rtjodOJuxYNaNHzOnKC5rK1SGuu3asv8eT47X8zN1x1SoSR/uzdx8+HQtIA5nJaccVwsHvDwoFE8T4nefM1o1PvSfIJmo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783411074; c=relaxed/simple; bh=MDXWwDyv4H+zTSE9teHwvvk4Sk0miT1w1S90181a0W0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rAGav4iM+DbQGQQkDtX0d11NmOFyUrY+YZMtFmQvkm+2pDfE8lpy362rgoyQwWaZhzPh3nTVKG27IBvu6wHdOjk2Tmbcy9QiQIhZkFr05XKRfiNyyKr+dLSmqjYFlLs1bYWsytAXz8UbFoIyZi4jod1DIr/AI6iPVkAZPf8fOPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SHpBTqMQ; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SHpBTqMQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1783411073; x=1814947073; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=MDXWwDyv4H+zTSE9teHwvvk4Sk0miT1w1S90181a0W0=; b=SHpBTqMQ/nyFCqe7rF2Ct3w+NKjFA/djfn3AOun8SbWCt3mZadN/8P/0 Hm8X5iW1Hhdf3+RmGxKcXgUVfvzMWzMV9mivXo11rg8ONinEx30Asx4WA 3OhkrqgLo9TlROxjMOAYAosmpXHLCl0qzZuwP7QRUemFRCCWb04QCCsYX 1kyqpihTsHqQ/ru15EDJ+ErGiB8stLFuRKAK34BQ8biTt0uXjitcvUAOu ZWNKPFiBltSXRxYCab5HlN2Uq1OrkaemKXKeZhw7WhufqroqOUo//Oklz 9sxSsAp+451yBkmL3DCmp9Rh70kbp6Rsdx9SIcMpT4Mv+Wz+PBMYfkG7j g==; X-CSE-ConnectionGUID: 8pC7S03kRQKanAwIv4ecvA== X-CSE-MsgGUID: uDO6EisCSci7rAHevXeTMw== X-IronPort-AV: E=McAfee;i="6800,10657,11839"; a="106851127" X-IronPort-AV: E=Sophos;i="6.25,153,1779174000"; d="scan'208";a="106851127" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2026 00:57:53 -0700 X-CSE-ConnectionGUID: 0+nViLfTQt+I+cab/HP/Jw== X-CSE-MsgGUID: G5wplcShRpagvXOrELIvlQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,153,1779174000"; d="scan'208";a="252185974" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa006.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2026 00:57:51 -0700 Date: Tue, 7 Jul 2026 09:57:47 +0200 From: Raag Jadav To: Guangshuo Li Cc: Alexander Usyskin , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Lucas De Marchi , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: intel-dg: Fix runtime PM error path in probe Message-ID: References: <20260705033107.276450-1-lgs201920130244@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260705033107.276450-1-lgs201920130244@gmail.com> 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 Reviewed-by: Raag Jadav