Re: [PATCH][next] platform/surface: fix potential integer overflow on shift of a int

2021-01-13 Thread Hans de Goede
Hi, On 1/11/21 3:46 PM, Colin King wrote: > From: Colin Ian King > > The left shift of int 32 bit integer constant 1 is evaluated using 32 bit > arithmetic and then passed as a 64 bit function argument. In the case where > func is 32 or more this can lead to an oveflow. Avoid this by shifting >

Re: [PATCH][next] platform/surface: fix potential integer overflow on shift of a int

2021-01-11 Thread Maximilian Luz
On 1/11/21 3:46 PM, Colin King wrote: From: Colin Ian King The left shift of int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then passed as a 64 bit function argument. In the case where func is 32 or more this can lead to an oveflow. Avoid this by shifting using the BIT_

[PATCH][next] platform/surface: fix potential integer overflow on shift of a int

2021-01-11 Thread Colin King
From: Colin Ian King The left shift of int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then passed as a 64 bit function argument. In the case where func is 32 or more this can lead to an oveflow. Avoid this by shifting using the BIT_ULL macro instead. Addresses-Coverity: