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=1796383400; b=sos1chNyQh5pKZ9DGjuB2NB5iA3aJhQ/yezvu4DNRjD/xDYltOxdQh8VNfUC9CTDg56g 9sUVW3MCYxtfx+zTUKoi6fA/jMlnK30m6osxi1XlY6kE4ZhSoLBSdgS65VBZHrE651tYe JW9xfZAVtV+s+oI1zX1z42EpW/rEzg399PoiRXFqIxuO+T6/I/SMV7ym7hEIR/aXzlh8o efoyOV1VdedGmBZouqywM5YBpPCq3VnL2GgJ3M2rvpX7AWjWbe7QPkUsb4cl/J9YORE4k OQ5Zrhqui1yGb7M6XtIdtKZXMJwXhrX+tq2eO/ZtxcUk0Mc0NiN6hHiolkahuv/U3IQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383400; 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=XNK3PaY14tJkByyB4Uroy4g4W0EJgDiPjQFaJGIaj3o=; b=A7Edevaobyfpo+KiRpDrYQUir+LM5po1dCsAfw8LOaA0CTYGNt8LY00mm+7Mt6az5Gn1 4pgN65NV23gI/j3rZ4AZqTr2e2MIPotGPmY6/gZcxn6eGSVhFGfY77xGUJXrVrshrNqih gTJRun/AkQl1TymZV2p7+W8m4sl9fbuIQeU0xDvLBNAuK1fTzsR1jcKp4+ETOp4DNtKP8 sWognWGzZ34xwIiMXarDIdKJVu78xNdF550bTRoCzM1/w91ZtDKO1bakyhBDqOtnFnXLD a/1XtnLYjlyjnZWwfw+WTbydDxl2t0CD/dTMOgq75cvRlNujJatpwFPQCxARUpMVzVQ== 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=Ux83y4+x; 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 8B44A606A32F; Fri, 4 Dec 2026 11:23:20 +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=Ux83y4+x Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07D8B1F000C2; Fri, 4 Dec 2026 11:23:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383400; bh=XNK3PaY14tJkByyB4Uroy4g4W0EJgDiPjQFaJGIaj3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ux83y4+xcKKzeHVE5/MeYFWT6auaRuyJP6OVpx8LFJOwsAFv+t4FlHowzyNnYlppR OI5Yv2+EzOxw6DdhTzvY1omzZFtKWTrwkMylc45MitDFSbm/bCkXmHDSDqxd6BTZS+ dg8Z1G+/Y2eL18hrkp6PKo434uQL+lLpTA72Xgr0= 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 6.12 210/555] dmaengine: idxd: Free the minor number when cdev setup fails Date: Fri, 4 Dec 2026 19:04:13 +0900 Message-ID: <20261204100616.668249738@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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 14b322ac6e6c6..1cd4afbdc8c68 100644 --- a/drivers/dma/idxd/cdev.c +++ b/drivers/dma/idxd/cdev.c @@ -576,6 +576,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