Linux-Serial Archive on
 help / color / Atom feed
* Re: tty: serial: lpuart driver (drivers/tty/serial/fsl_lpuart.c): commit 5887ad43ee02a00f1
       [not found] <>
@ 2020-07-17  7:32 ` gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2020-07-17  7:32 UTC (permalink / raw)
  To: Vabhav Sharma (OSS); +Cc: bhuvanchandra.dv, linux-serial

On Fri, Jul 17, 2020 at 07:01:03AM +0000, Vabhav Sharma (OSS) wrote:
> Hello Greg, Bhuvanchandra DV,
> Static analysis tool is run against upstream kernel tree and found medium priority coverity issue against changes: commit 5887ad43ee02a00f17a6132b7fb256dc6865474c
> Below are details
> sport->rx_dma_rng_buf_len = (1 << (fls(sport->rx_dma_rng_buf_len) - 1));
> Bad bit shift operation, The operation may have an undefined behavior or yield an unexpected result.
> A bit shift operation has a shift amount which is too large or has a negative value.
> zero_return: Function call fls(sport->rx_dma_rng_buf_len) returns 0
> CID 9000793 (#5 of 5):
> Bad bit shift operation (BAD_SHIFT)4. negative_shift: In expression 1 << fls(sport->rx_dma_rng_buf_len) - 1, shifting by a negative amount has undefined behavior. The shift amount, fls(sport->rx_dma_rng_buf_len) - 1, is -1.
> Would you like to push changes for fixing the coverity issue.

Can you submit a patch for this, no need to make someone else do it :)

And note, html email is rejected by the mailing lists.


greg k-h

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <>
2020-07-17  7:32 ` tty: serial: lpuart driver (drivers/tty/serial/fsl_lpuart.c): commit 5887ad43ee02a00f1 gregkh

Linux-Serial Archive on

Archives are clonable:
	git clone --mirror linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ \
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone