]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: idxd: fix off by one on cdev dwq refcount
authorDave Jiang <dave.jiang@intel.com>
Thu, 12 Mar 2020 16:23:53 +0000 (09:23 -0700)
committerVinod Koul <vkoul@kernel.org>
Mon, 23 Mar 2020 06:02:06 +0000 (11:32 +0530)
commit61761ce06b6f9dbad14f6df6aa5b258b344b6e6e
tree0ecd6588e4c4a943384889fcf041261080b7086b
parent64a5ed678ef7c40001967215a3172c5e577d7397
dmaengine: idxd: fix off by one on cdev dwq refcount

The refcount check for dedicated workqueue (dwq) is off by one and allows
more than 1 user to open the char device. Fix check so only a single user
can open the device.

Fixes: 25d0801b8aad ("dmaengine: idxd: add char driver to expose submission portal to userland")
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/158403020187.10208.14117394394540710774.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/cdev.c