]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
dmaengine: idxd: Fix the error handling path in idxd_cdev_register()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 21 Apr 2022 06:13:38 +0000 (08:13 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:25:01 +0000 (09:25 +0200)
commit4ef92190b7f41a28bef845a4b058dc123e5114a7
tree2f029bdcdd6a42bb291f80bec8f9d07bd3618574
parenta21556ceb79691b62fe71e52972c50ec967ebc76
dmaengine: idxd: Fix the error handling path in idxd_cdev_register()

BugLink: https://bugs.launchpad.net/bugs/1981864
[ Upstream commit aab08c1aac01097815fbcf10fce7021d2396a31f ]

If a call to alloc_chrdev_region() fails, the already allocated resources
are leaking.

Add the needed error handling path to fix the leak.

Fixes: 42d279f9137a ("dmaengine: idxd: add char driver to expose submission portal to userland")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/1b5033dcc87b5f2a953c413f0306e883e6114542.1650521591.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/dma/idxd/cdev.c