Re: [PATCH][next] can: usb: fix potential integer overflow on shift of a int

2020-11-05 Thread Marc Kleine-Budde
On 11/5/20 12:24 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 assigned to a signed 64 bit variable. In > the case where time_ref->adapter->ts_used_bits is 32 or more this > can lead to an oveflow.

[PATCH][next] can: usb: fix potential integer overflow on shift of a int

2020-11-05 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 assigned to a signed 64 bit variable. In the case where time_ref->adapter->ts_used_bits is 32 or more this can lead to an oveflow. Avoid this by shifting using the BIT_ULL macro inst