[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2NtTXwMef0kp01s@qemulion>
Date: Thu, 3 Nov 2022 12:57:09 +0530
From: Deepak R Varma <drv@...lo.com>
To: outreachy@...ts.linux.dev,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: staging: emxx_udc question on i_write_length datatype
Hello,
While reviewing this [1] coccicheck warning, I observed something that concerned
me. The variable i_write_length is declared to be of u32 type. Later it is
assigned a value DMA_MAX_COUNT * mpkt; which is 256 * u32;
I am unable to estimate if mpkt (or max packet size) can attain value greater
than 16777215 in which case the result will overflow the 32 bits of
i_write_length. Is it safe to make i_write_length to be a u64?
[1] drivers/staging/emxx_udc/emxx_udc.c:1007:28-29: WARNING opportunity for min()
Powered by blists - more mailing lists