Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp486668ybl; Tue, 28 Jan 2020 06:43:02 -0800 (PST) X-Google-Smtp-Source: APXvYqyN9ZI6nswrAGo4Fi0D38uaLDjYmBfz2A1NbNAQNpAFwZxOVpu/SVq3l/Cd0Mf5MavspTNs X-Received: by 2002:aca:2419:: with SMTP id n25mr3100955oic.13.1580222581941; Tue, 28 Jan 2020 06:43:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222581; cv=none; d=google.com; s=arc-20160816; b=kHL/glFrMOag3ybvW1sH4DFoyobJgj6r75qFSjg3pXy+sN2gZwQNzxMLE18/rBrftJ p6SlpjhoMFWZaEspW+PDIJ4XCznHubsh+SM1fB34yqxxIXcAph1OAoTP9fpaLDA7YTd+ ElvRXx1wS/ifepouXkuYD6NPgDuQh6B/SiuDTRIPCXXiZZV9zrgcxKyAME0keJ8FNKsO PoSScr9AM2QBHvTATA61a2WBPLEE/IiXzcZR+ZkCW4TTlylSwRwOD82HcsGVyw5zUNO0 qWP91hDpZxBrH50SgBqrkKLkrB9RPMB//MWBIQAXx1Pi93rCkC+HZMY4pGK3uECbuui6 3ewQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fRFSs3vmgfDJ+SSIL9uoHacIM01FZYrAVRBCAVoCYrE=; b=PyknvA0+HhoysVeq4j1IVr6KWiqhgY/iNxLPvMdfvl0TqttCE5XK1vkzSa8Xz3pOBY YusjW0ACKqNgb5P3mD08ts0ngq1nVD822yxNxVwWak1Wiyfl8VyPho72zku09nkW/svV JfzkKUF4/yow9N1lYz2Xg6ZHmkIpDlum/wD+zK9Z17lzcsAhZb7IIARJg5AhlOvcWRMo MlCvYOsv+fpE4DaFmlbOiVMnZy7M98dpA333SpMjO6c4Mz8ukC29W1SKN0QyI+vVE0Yq eSkKbUkXk4rG15LiyMTSVq3+r3YQFpGEbI5B+TE5vx5THZPPDNNHyOm17KyDt4DmdhKU oDFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BgC+sctN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i78si5355595oib.1.2020.01.28.06.42.50; Tue, 28 Jan 2020 06:43:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BgC+sctN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730177AbgA1OPq (ORCPT + 99 others); Tue, 28 Jan 2020 09:15:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:38546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730158AbgA1OPn (ORCPT ); Tue, 28 Jan 2020 09:15:43 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 90E5C20678; Tue, 28 Jan 2020 14:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220943; bh=SJ5RdmOGfQs5mLEPAX0sUe3M8Uc/nvXTm72BCGqymo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BgC+sctN4NBONc0rcZuYv5R3tUY6Ywq8ZzPLtCHLku8TOAem29yRlxhVB5KPysbwD 5Xn1PhPt9LD7P92taVQGwg8A9hto/Y1GwewtSr2TCixYbVHAQl7AjZjKOx0kbZdRpc R3fV0UJFpo3VCyS2T44CB5DFJzLyTP4ilARov97I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.9 025/271] Input: nomadik-ske-keypad - fix a loop timeout test Date: Tue, 28 Jan 2020 15:02:54 +0100 Message-Id: <20200128135854.542869074@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 4d8f727b83bcd6702c2d210330872c9122d2d360 ] The loop exits with "timeout" set to -1 not to 0. Fixes: 1158f0f16224 ("Input: add support for Nomadik SKE keypad controller") Signed-off-by: Dan Carpenter Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/keyboard/nomadik-ske-keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c index 8567ee47761e1..ae3b045570740 100644 --- a/drivers/input/keyboard/nomadik-ske-keypad.c +++ b/drivers/input/keyboard/nomadik-ske-keypad.c @@ -100,7 +100,7 @@ static int __init ske_keypad_chip_init(struct ske_keypad *keypad) while ((readl(keypad->reg_base + SKE_RIS) != 0x00000000) && timeout--) cpu_relax(); - if (!timeout) + if (timeout == -1) return -EINVAL; /* -- 2.20.1