Skip to content

Commit

Permalink
dmaengine: idxd: Fix ->poll() return value
Browse files Browse the repository at this point in the history
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: 8dfa57a ("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>
  • Loading branch information
Dave Jiang authored and Vinod Koul committed May 14, 2025
1 parent a409e91 commit ae74cd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma/idxd/cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ae74cd1

Please sign in to comment.