dmaengine: idxd: wq size configuration needs to check global max size
authorDave Jiang <dave.jiang@intel.com>
Wed, 19 Feb 2020 17:24:56 +0000 (10:24 -0700)
committerVinod Koul <vkoul@kernel.org>
Mon, 24 Feb 2020 16:32:34 +0000 (22:02 +0530)
commit50e7e7f6f2d040dd16a636f408eab9184abc63f8
treed2ec9b5ab05ab731010bea4aa9151c1df1afc1b5
parent88402c5b1ba7498217027c8a54e8df61d030500c
dmaengine: idxd: wq size configuration needs to check global max size

The current size_store() function for idxd sysfs does not check the total
wq size. This allows configuration of all wqs with total wq size. Add check
to make sure the wq sysfs attribute rejects storing of size over the total
wq size.

Fixes: c52ca478233c ("dmaengine: idxd: add configuration component of driver")
Reported-by: Jerry Chen <jerry.t.chen@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/158213309629.2509.3583411832507185041.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/sysfs.c