]> git.baikalelectronics.ru Git - 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)
committerVinod Koul <vkoul@kernel.org>
Mon, 16 May 2022 11:28:32 +0000 (16:58 +0530)
commit05038d9c1f555197e3c16bff4e559b58ef59c020
treeba2d01a8b20134d1c5b759a9576fbcb22d19657b
parent7cb49cacb46d5c32852aa4b0dbeb05b2e7300ee9
dmaengine: idxd: Fix the error handling path in idxd_cdev_register()

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: dfcb650c7779 ("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>
drivers/dma/idxd/cdev.c