public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* staging: emxx_udc question on i_write_length datatype
@ 2022-11-03  7:27 Deepak R Varma
  2022-11-03  7:55 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Deepak R Varma @ 2022-11-03  7:27 UTC (permalink / raw)
  To: outreachy, Greg Kroah-Hartman, linux-staging, linux-kernel

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()



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-03  8:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-03  7:27 staging: emxx_udc question on i_write_length datatype Deepak R Varma
2022-11-03  7:55 ` Dan Carpenter
2022-11-03  8:12   ` Deepak R Varma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox