False positive.  Smatch is using the highest possible values of "tplen"
and "offset" but they both can't be maxed at the same time.

regards,
dan carpenter

On Sat, Mar 29, 2014 at 02:05:37AM +0800, kbuild test robot wrote:
> TO: Lothar Waßmann <l...@karo-electronics.de>
> CC: Dmitry Torokhov <dmitry.torok...@gmail.com>
> 
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
> head:   608edb0f130a90823892eaaf48de159bdc849a00
> commit: fd335ab04b3f1b3309dfbfea71a1a79a7bacc4ad [498/499] Input: edt-ft5x06 
> - add support for M09 firmware version
> :::::: branch date: 80 minutes ago
> :::::: commit date: 2 hours ago
> 
> drivers/input/touchscreen/edt-ft5x06.c:222 edt_ft5x06_ts_isr() warn: buffer 
> overflow 'rdbuf' 29 <= 29
> 
> git remote add input 
> git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
> git remote update input
> git checkout fd335ab04b3f1b3309dfbfea71a1a79a7bacc4ad
> vim +/rdbuf +222 drivers/input/touchscreen/edt-ft5x06.c
> 
> 43c4d13e Simon Budig    2012-07-24  206  
> fd335ab0 Lothar Waßmann 2014-03-28  207       /* M09 does not send header or 
> CRC */
> fd335ab0 Lothar Waßmann 2014-03-28  208       if (tsdata->version == M06) {
> fd335ab0 Lothar Waßmann 2014-03-28  209               if (rdbuf[0] != 0xaa || 
> rdbuf[1] != 0xaa ||
> fd335ab0 Lothar Waßmann 2014-03-28  210                       rdbuf[2] != 
> datalen) {
> fd335ab0 Lothar Waßmann 2014-03-28  211                       
> dev_err_ratelimited(dev,
> fd335ab0 Lothar Waßmann 2014-03-28  212                                       
> "Unexpected header: %02x%02x%02x!\n",
> fd335ab0 Lothar Waßmann 2014-03-28  213                                       
> rdbuf[0], rdbuf[1], rdbuf[2]);
> fd335ab0 Lothar Waßmann 2014-03-28  214                       goto out;
> fd335ab0 Lothar Waßmann 2014-03-28  215               }
> 43c4d13e Simon Budig    2012-07-24  216  
> fd335ab0 Lothar Waßmann 2014-03-28  217               if 
> (!edt_ft5x06_ts_check_crc(tsdata, rdbuf, datalen))
> fd335ab0 Lothar Waßmann 2014-03-28  218                       goto out;
> fd335ab0 Lothar Waßmann 2014-03-28  219       }
> 43c4d13e Simon Budig    2012-07-24  220  
> 43c4d13e Simon Budig    2012-07-24  221       for (i = 0; i < 
> MAX_SUPPORT_POINTS; i++) {
> fd335ab0 Lothar Waßmann 2014-03-28 @222               u8 *buf = &rdbuf[i * 
> tplen + offset];
> 43c4d13e Simon Budig    2012-07-24  223               bool down;
> 43c4d13e Simon Budig    2012-07-24  224  
> 43c4d13e Simon Budig    2012-07-24  225               type = buf[0] >> 6;
> 43c4d13e Simon Budig    2012-07-24  226               /* ignore Reserved 
> events */
> 43c4d13e Simon Budig    2012-07-24  227               if (type == 
> TOUCH_EVENT_RESERVED)
> 43c4d13e Simon Budig    2012-07-24  228                       continue;
> 43c4d13e Simon Budig    2012-07-24  229  
> fd335ab0 Lothar Waßmann 2014-03-28  230               /* M06 sometimes sends 
> bogus coordinates in TOUCH_DOWN */
> 
> ---
> 0-DAY kernel build testing backend              Open Source Technology Center
> http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
_______________________________________________
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild

Reply via email to