Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751098AbeAPIlN (ORCPT + 1 other); Tue, 16 Jan 2018 03:41:13 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:47410 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750816AbeAPIlM (ORCPT ); Tue, 16 Jan 2018 03:41:12 -0500 Date: Tue, 16 Jan 2018 11:40:51 +0300 From: Dan Carpenter To: kbuild@01.org, Xiongfeng Wang Cc: kbuild-all@01.org, miguel.ojeda.sandonis@gmail.com, linux-kernel@vger.kernel.org, arnd@arndb.de, wangxiongfeng2@huawei.com, Dan Carpenter Subject: Re: [PATCH] auxdisplay: use correct string length Message-ID: <20180116084051.sdgqdzaqluasfofx@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515413285-40933-1-git-send-email-wangxiongfeng2@huawei.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8775 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801160127 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: [ The kbuild robot is being tweaked so the actual warnings are missing but it's easy enough to guess what it was - dan ] Hi Xiongfeng, Thank you for the patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Xiongfeng-Wang/auxdisplay-use-correct-string-length/20180110-180916 # https://github.com/0day-ci/linux/commit/eab240fbc00377bf3e18428b401e651bd6296da0 git remote add linux-review https://github.com/0day-ci/linux git remote update linux-review git checkout eab240fbc00377bf3e18428b401e651bd6296da0 vim +1512 drivers/auxdisplay/panel.c 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1483 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1484 /* tries to bind a key to the signal name . The key will send the 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1485 * strings , , for these respective events. 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1486 * Returns the pointer to the new key if ok, NULL if the key could not be bound. 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1487 */ 36d2041a3 drivers/staging/panel/panel.c Peter Huewe 2013-02-15 1488 static struct logical_input *panel_bind_key(const char *name, const char *press, 36d2041a3 drivers/staging/panel/panel.c Peter Huewe 2013-02-15 1489 const char *repeat, 36d2041a3 drivers/staging/panel/panel.c Peter Huewe 2013-02-15 1490 const char *release) 698b1515f drivers/staging/panel/panel.c Willy Tarreau 2008-11-22 1491 { 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1492 struct logical_input *key; 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1493 fdf4a4948 drivers/staging/panel/panel.c Dominique van den Broeck 2014-05-21 1494 key = kzalloc(sizeof(*key), GFP_KERNEL); eb073a9bf drivers/staging/panel/panel.c Toshiaki Yamane 2012-07-12 1495 if (!key) 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1496 return NULL; eb073a9bf drivers/staging/panel/panel.c Toshiaki Yamane 2012-07-12 1497 698b1515f drivers/staging/panel/panel.c Willy Tarreau 2008-11-22 1498 if (!input_name2mask(name, &key->mask, &key->value, &scan_mask_i, cb46f472c drivers/staging/panel/panel.c Kulikov Vasiliy 2010-07-12 1499 &scan_mask_o)) { cb46f472c drivers/staging/panel/panel.c Kulikov Vasiliy 2010-07-12 1500 kfree(key); 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1501 return NULL; cb46f472c drivers/staging/panel/panel.c Kulikov Vasiliy 2010-07-12 1502 } 698b1515f drivers/staging/panel/panel.c Willy Tarreau 2008-11-22 1503 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1504 key->type = INPUT_TYPE_KBD; 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1505 key->state = INPUT_ST_LOW; 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1506 key->rise_time = 1; 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1507 key->fall_time = 1; 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1508 eab240fbc drivers/auxdisplay/panel.c Xiongfeng Wang 2018-01-08 1509 strncpy(key->u.kbd.press_str, press, sizeof(key->u.kbd.press_str) - 1); eab240fbc drivers/auxdisplay/panel.c Xiongfeng Wang 2018-01-08 1510 strncpy(key->u.kbd.repeat_str, repeat, sizeof(key->u.kbd.repeat_str) - 1); 698b1515f drivers/staging/panel/panel.c Willy Tarreau 2008-11-22 1511 strncpy(key->u.kbd.release_str, release, eab240fbc drivers/auxdisplay/panel.c Xiongfeng Wang 2018-01-08 @1512 sizeof(key->u.kbd.release_str - 1)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The " - 1" shouldn't be inside the sizeof(). It should be: sizeof(key->u.kbd.release_str) - 1); 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1513 list_add(&key->list, &logical_inputs); 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1514 return key; 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1515 } 7005b5845 drivers/staging/panel/panel.c Willy Tarreau 2008-11-13 1516 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation