lkml.org 
[lkml]   [2018]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next] ieee802154: ca8210: remove a dead branch
From
Date
On 2018/12/11 4:04, David Miller wrote:
> From: YueHaibing <yuehaibing@huawei.com>
> Date: Mon, 10 Dec 2018 19:34:43 +0800
>
>> Fix follwing gcc warning:
>>
>> drivers/net/ieee802154/ca8210.c:730:10: warning:
>> comparison is always false due to limited range of data type [-Wtype-limits]
>>
>> the variable 'len' is of type u8 and cannot greater than
>> CA8210_SPI_BUF_SIZE , which is 256.
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>
> Then bug is the variable type here.
>
> We are reading a u8 from buf[], then adding 2, which can overflow.
>
> 'len' should be an unsigned int or similar.

Oh, Yes, will do it in v2.

>
> .
>

\
 
 \ /
  Last update: 2018-12-11 02:52    [W:0.852 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site