From patchwork Mon Jul 6 12:31:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 6723151 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BAA689F3A0 for ; Mon, 6 Jul 2015 12:32:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8DE42062F for ; Mon, 6 Jul 2015 12:32:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F40D620628 for ; Mon, 6 Jul 2015 12:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755537AbbGFMbm (ORCPT ); Mon, 6 Jul 2015 08:31:42 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:53789 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754646AbbGFMbi (ORCPT ); Mon, 6 Jul 2015 08:31:38 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t66CVXqP014211; Mon, 6 Jul 2015 07:31:33 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t66CVXIW004956; Mon, 6 Jul 2015 07:31:33 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Mon, 6 Jul 2015 07:31:21 -0500 Received: from rockdesk.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t66CVUHM028119; Mon, 6 Jul 2015 07:31:31 -0500 From: Roger Quadros To: CC: , , , Roger Quadros , Greg Kroah-Hartman Subject: [PATCH] extcon: Fix kernel hang for find_cable_index_by_name() users Date: Mon, 6 Jul 2015 15:31:29 +0300 Message-ID: <1436185889-773-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Users of find_cable_index_by_name() will cause a kernel hang as the while loop counter is never incremented and end condition is never reached. Fixes: commit 73b6ecdb93e8 ("extcon: Redefine the unique id of supported external connectors without 'enum extcon' type") Cc: Greg Kroah-Hartman Signed-off-by: Roger Quadros --- drivers/extcon/extcon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 76157ab..1acc830 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -138,6 +138,8 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name) id = i; break; } + + i++; } if (id == EXTCON_NONE)