dmaengine: idxd: fix wq size store permission state
[ Upstream commit0fff71c5a3] WQ size can only be changed when the device is disabled. Current code allows change when device is enabled but wq is disabled. Change the check to detect device state. Fixes:c52ca47823("dmaengine: idxd: add configuration component of driver") Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161782558755.107710.18138252584838406025.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
db23b7b5ca
commit
4ecf255952
1 changed files with 1 additions and 1 deletions
|
|
@ -923,7 +923,7 @@ static ssize_t wq_size_store(struct device *dev,
|
|||
if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
|
||||
return -EPERM;
|
||||
|
||||
if (wq->state != IDXD_WQ_DISABLED)
|
||||
if (idxd->state == IDXD_DEV_ENABLED)
|
||||
return -EPERM;
|
||||
|
||||
if (size + total_claimed_wq_size(idxd) - wq->size > idxd->max_wq_size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue