From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380154; b=CJm0g28ThXmxJcuZ9cslE0TmfzmzhlJ4rgeHXY4vRJqOPd2vg/84CLam/JqN+Et0uCuQ 4t0Lif40QAvSeTqmK0QXJfRKPmtJZQMYhAwYoI/oSXdfjRHwIiF1gfjFB+qQF+x4irEgj asDbiJ8KgpOUydVbWvXY+kp3TrebDkiZT73TsD2vgXmLrrjJQLfYXJxtwmIYwU9ZoVCyw eP4lkUIaRGbgkp1QVxYnBYtPZUyXT2UCyzdLUDijY8nP4WbO2g4LKaix52JzuOukgNGjj J7Ex0NUuWjQBqsWJeXVBe1QMvS7fnPjUD86MUZ6+vDTYLk7dCGhp/liDGLIC4dXnT6Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380154; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=wAxglMNuYYK2nHx0HFec6ojBeHj6hVgKN6EmI3G7EuA=; b=fcraDhuj1K1iqXS2+gO7/J8LGIadCHZpStuCTfGldT5sJLw96NGVWT704ZMa3g+gV88Q AEcbXtZAQ8nGlCt0IoaP2Y6Z/XDjSVqG2rVQZiY0lQ2Ezr1TXOcsjGhKIpYFnvyXssfkI nedwGR96eCldxyDw/Lg5yU9TuWQkjN+MigoiR7mIN851GkM92XxiGKye53MwFXOKMKRR7 SC3P5cyzklH751oDtzGKUCz3OyR+yq3EFW8eXP6d9CJCsJVvFK01ZqblA1ax1nW9TzpZh 9CNxU/Lv+iQZ+02vamfA6r9v1qd6g5G9mGMzYzoW+UORXdG6vvqjrWBWPz564k4dR7A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yP3xe0sK; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA32B606A69F; Fri, 4 Dec 2026 10:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yP3xe0sK Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39C071F000CE; Fri, 4 Dec 2026 10:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380154; bh=wAxglMNuYYK2nHx0HFec6ojBeHj6hVgKN6EmI3G7EuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yP3xe0sKw2vLi+bT/MrDiyCCyh2OWoHNhfB0gwU+8sRBYq5lO2BSfVZAf6QExnh5w NyhEpzhTLKDSO503MW8oKHwyY+t+Wt3Us5SrAYmBtrokrfAZrJLdWahuegYNu6A1wm uCVxbGOyNXu4X0dCRVMOtxqnzICOKKZ2sNFA9Qss= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, SeungUk Nam , Frank Li , Vinod Koul , Sasha Levin Subject: [PATCH 7.3 151/742] dmaengine: idxd: Free the minor number when cdev setup fails Date: Fri, 4 Dec 2026 19:00:15 +0900 Message-ID: <20261204100639.129489437@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: SeungUk Nam [ Upstream commit 56cbd7f69ce6037738410a5c50efb7cacf52b0ae ] idxd_wq_add_cdev() allocates a minor number from cdev_ctx->minor_ida for the new struct idxd_cdev. When dev_set_name() or cdev_device_add() fails, the error path calls put_device(), and the release callback idxd_cdev_dev_release() only frees idxd_cdev, so the minor number is never returned to the ida. Leaked numbers accumulate across bind/unbind cycles, up to MINORMASK, for as long as the module stays loaded. Free the minor number before put_device() drops the last reference on that path. Fixes: c311f5e92484 ("dmaengine: idxd: Fix freeing the allocated ida too late") Signed-off-by: SeungUk Nam Reviewed-by: Frank Li Link: https://patch.msgid.link/20260910074832.15729-1-tmddnr49449@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/idxd/cdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c index 82b07cf942ef8..f1af7f0d25d34 100644 --- a/drivers/dma/idxd/cdev.c +++ b/drivers/dma/idxd/cdev.c @@ -573,6 +573,7 @@ int idxd_wq_add_cdev(struct idxd_wq *wq) return 0; err: + ida_free(&cdev_ctx->minor_ida, minor); put_device(dev); wq->idxd_cdev = NULL; return rc; -- 2.53.0