raw/ioat: fix queue index calculation
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 5 Nov 2020 10:41:04 +0000 (10:41 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 13 Nov 2020 14:30:08 +0000 (15:30 +0100)
commit242623459e5e534a99e32e20ffcf12e6f56c2f51
tree2f4c75d64833ff27d0dc57313d9c5f825aed3203
parent52a7cb0ad03a032ff33766cb1dc8553c17634ca6
raw/ioat: fix queue index calculation

Coverity flags a possible problem where the 8-bit wq_idx value may have
errors when shifted and sign-extended to pointer size. Since this can
only occur if the shift index is larger than any expected value from
hardware, it's unlikely to cause any real problems, but we can eliminate
any possible errors, and the coverity issue, by explicitly typecasting
the uint8_t value to uintptr_t before any shift operations occur.

Coverity issue: 363695
Fixes: a33969462135 ("raw/ioat: fix work-queue config size")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
drivers/raw/ioat/idxd_pci.c