habanalabs: cast to u64 before shift > 31 bits
authorOded Gabbay <oded.gabbay@gmail.com>
Sat, 29 Aug 2020 08:24:03 +0000 (11:24 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 22 Sep 2020 15:49:51 +0000 (18:49 +0300)
commitf763946aefe67b3ea58696b75a930ba1ed886a83
tree1976f43f7462efc719f263b450baf10ff4dd7064
parent2f55342c5e4d3ea94c0b8237f3ad26963269f90f
habanalabs: cast to u64 before shift > 31 bits

When shifting a boolean variable by more than 31 bits and putting the
result into a u64 variable, we need to cast the boolean into unsigned 64
bits to prevent possible overflow.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/goya/goya.c