dmaengine: idxd: Fix ->poll() return value
authorDave Jiang <dave.jiang@intel.com>
Thu, 8 May 2025 17:05:48 +0000 (10:05 -0700)
committerVinod Koul <vkoul@kernel.org>
Wed, 14 May 2025 13:52:55 +0000 (14:52 +0100)
The fix to block access from different address space did not return a
correct value for ->poll() change.  kernel test bot reported that a
return value of type __poll_t is expected rather than int. Fix to return
POLLNVAL to indicate invalid request.

Fixes: 8dfa57aabff6 ("dmaengine: idxd: Fix allowing write() from different address spaces")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505081851.rwD7jVxg-lkp@intel.com/
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20250508170548.2747425-1-dave.jiang@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/cdev.c

index a2fb2b84775263be170b49aa1aa08f1cb66b8920..6d12033649f817368df69a5e8864775073a47a24 100644 (file)
@@ -500,7 +500,7 @@ static __poll_t idxd_cdev_poll(struct file *filp,
        __poll_t out = 0;
 
        if (current->mm != ctx->mm)
-               return -EPERM;
+               return POLLNVAL;
 
        poll_wait(filp, &wq->err_queue, wait);
        spin_lock(&idxd->dev_lock);