Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1337724

Re: [PATCH] rose: correct integer overflow check

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH] rose: correct integer overflow check
Date 2016-02-18 21:40 +0100
Message-ID <r3DwK-2Fr-5@gated-at.bofh.it> (permalink)
References <r3gTw-36M-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Insu Yun <wuninsu@gmail.com>
Date: Wed, 17 Feb 2016 15:25:13 -0500

> Since rose_ndevs is signed integer type,
> it can be overflowed when it is negative.
> 
> Signed-off-by: Insu Yun <wuninsu@gmail.com>

That's not how the expression is evaluated.

Because of the types on the right hand side of the comparison
the expressions are all promoted to unsigned.

Did you look at the compiler's assembler output?  I did when
reviewing your patch.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] rose: correct integer overflow check Insu Yun <wuninsu@gmail.com> - 2016-02-17 21:30 +0100
  Re: [PATCH] rose: correct integer overflow check David Miller <davem@davemloft.net> - 2016-02-18 21:40 +0100
    Re: [PATCH] rose: correct integer overflow check Ralf Baechle <ralf@linux-mips.org> - 2016-02-19 01:00 +0100

csiph-web