From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 EFB4B376A1B; Wed, 23 Sep 2026 14:31:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790173875; cv=none; b=PhEwULdDQjxs3AEKLZtMxBAGpyKgL6Gr+C1r4okknKh3cpbqvAqjzXJQN2UoM6HrvRy56tpNyMVwFpOsqfghzUuds2WJN6mEryau+xt7SfflAWYVVYzrH34V/twWb0pS+KPcR57qvlfYinIKc+/IUeFllkXp9XgyAcveIwesgno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790173875; c=relaxed/simple; bh=/kw7Yjox+UpIZlLnfKDq1QiXyQI4sQcYflSXyn8Nxjo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l0DgGC4nINc/UlBLaVrUZ9pbpH6P/CIa5t3JT5Bn9/lNVOLUFV7lhS9fenx32lGwXjOeeZ+4IkdKLtXmtBdbvSs0HXssXJ8X7Z1HHID7UD/8SoveUOTekMMvRAyp3oi+U5w1cqjNW3M9zBThFrhhow/8Uu2qJuqyDpv8EYBRNzQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZVTsfH/e; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZVTsfH/e" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 509801F000FF; Wed, 23 Sep 2026 14:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790173873; bh=zg49ZkNj4IstTLji5OXpwATsobtL+ZT4eiIB+64cmdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZVTsfH/eFOzxcqtWiDE7b+2Yo2MqTRbDY1bAC+MIUIe6Y+B4rtsr8TpyvBdpVcUMh VsmN8R65mRVS5HnKH1iJbvVoPSiNxO998LWVGwW4rP56v4UsGNx0if7uPCgKvonVtp sdVHMSJ56lyYzVYmQQjPn8DG+6GimpabmzqOObt4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, sashiko-bot , Bartosz Golaszewski Subject: [PATCH 7.2 337/438] power: sequencing: fix NULL-pointer dereference in pwrseq_unit_new() Date: Wed, 23 Sep 2026 16:05:58 +0200 Message-ID: <20260923140653.550499873@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260923140644.756254324@linuxfoundation.org> References: <20260923140644.756254324@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bartosz Golaszewski commit 115b303e8e093d964089ec6f3c40d984d77b33d0 upstream. If memory allocation fails in pwrseq_unit_setup_deps(), pwrseq_unit_put() is called to release the partially initialized unit. However, we've never initialized unit->list and pwrseq_unit_release() will unconditionally call list_del() on it. Initialize unit->list right after allocating the unit struct. Fixes: 249ebf3f65f8 ("power: sequencing: implement the pwrseq core") Cc: stable@vger.kernel.org Reported-by: sashiko-bot Closes: https://sashiko.dev/#/patchset/20260903-pwrseq-kunit-v1-0-1f893d2cabc2%40oss.qualcomm.com?part=1 Link: https://patch.msgid.link/20260909-pwrseq-kunit-v2-2-ef496afc89d2@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman --- drivers/power/sequencing/core.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/power/sequencing/core.c +++ b/drivers/power/sequencing/core.c @@ -101,6 +101,7 @@ static struct pwrseq_unit *pwrseq_unit_n } kref_init(&unit->ref); + INIT_LIST_HEAD(&unit->list); INIT_LIST_HEAD(&unit->deps); unit->enable = data->enable; unit->disable = data->disable;