Re: [PATCH] staging: comedi: dt2811: fix integer overflow in multiply

2019-02-03 Thread Dan Carpenter
On Sun, Feb 03, 2019 at 02:29:04PM +0300, Dan Carpenter wrote: > > diff --git a/drivers/staging/comedi/drivers/dt2811.c > > b/drivers/staging/comedi/drivers/dt2811.c > > index 05207a519755..820e75f850ff 100644 > > --- a/drivers/staging/comedi/drivers/dt2811.c > > +++ b/drivers/staging/comedi/drive

Re: [PATCH] staging: comedi: dt2811: fix integer overflow in multiply

2019-02-03 Thread Dan Carpenter
On Sat, Feb 02, 2019 at 09:59:16PM +, Colin King wrote: > From: Colin Ian King > > Multiplying two unsigned ints leads to an unsigned int result. The > intention is that the result is a unsigned long long, so to fix the > overflow cast the div to an unsigned long long to ensure that the > mul

[PATCH] staging: comedi: dt2811: fix integer overflow in multiply

2019-02-02 Thread Colin King
From: Colin Ian King Multiplying two unsigned ints leads to an unsigned int result. The intention is that the result is a unsigned long long, so to fix the overflow cast the div to an unsigned long long to ensure that the multiplication is on unsigned long longs to avoid overflow. Detected by Co