dma/idxd: fix truncated error code in status check
authorKevin Laatz <kevin.laatz@intel.com>
Tue, 26 Oct 2021 14:20:45 +0000 (14:20 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 27 Oct 2021 15:01:56 +0000 (17:01 +0200)
commit452c1916b0dbb414a28dff89c995253da1c23c0b
treed5983771aa73ba8819b7ca26397b048ad1314530
parentbb4141dbe5da2924d5b9f8554fd022721d2cc127
dma/idxd: fix truncated error code in status check

When checking if the DMA device is active, the result of the operand will
always be zero since the err_code is truncated to 8 bits which makes
checking the 31st bit impossible.

This is fixed by changing the type of err_code to uint32_t so that it is
not truncated.

Coverity issue: 373657
Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe")

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
drivers/dma/idxd/idxd_pci.c