Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933229AbbHIVf3 (ORCPT ); Sun, 9 Aug 2015 17:35:29 -0400 Received: from dub004-omc1s5.hotmail.com ([157.55.0.204]:65313 "EHLO DUB004-OMC1S5.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754608AbbHIVf2 convert rfc822-to-8bit (ORCPT ); Sun, 9 Aug 2015 17:35:28 -0400 X-Greylist: delayed 302 seconds by postgrey-1.27 at vger.kernel.org; Sun, 09 Aug 2015 17:35:28 EDT X-TMN: [nbeNloSbL/jpz6rq9iWdQzGOAyxXXp0g] X-Originating-Email: [dcb314@hotmail.com] Message-ID: From: David Binderman To: "myungjoo.ham@samsung.com" , "cw00.choi@samsung.com" , "linux-kernel@vger.kernel.org" Subject: linux-4.2-rc6/drivers/extcon/extcon.c: 3 * bad tests ? Date: Sun, 9 Aug 2015 21:30:24 +0000 Importance: Normal Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginalArrivalTime: 09 Aug 2015 21:30:25.0057 (UTC) FILETIME=[9A88A110:01D0D2EA] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 879 Lines: 39 Hello there, 1. [linux-4.2-rc6/drivers/extcon/extcon.c:153]: (style) Checking if unsigned variable 'id' is less than zero. Source code is ??? id = find_cable_id_by_name(edev, name); ??? if (id < 0) but ?? unsigned int id; Suggest sanity check return value from find_cable_id_by_name *before* assigning it into an unsigned variable. 2. [linux-4.2-rc6/drivers/extcon/extcon.c:384]: (style) Checking if unsigned variable 'id' is less than zero. Duplicate. 3. [linux-4.2-rc6/drivers/extcon/extcon.c:432]: (style) Checking if unsigned variable 'id' is less than zero. Another duplicate. Regards David Binderman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/