From patchwork Tue Sep 18 05:22:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hutterer X-Patchwork-Id: 10603733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB5905A4 for ; Tue, 18 Sep 2018 05:23:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93C482849D for ; Tue, 18 Sep 2018 05:23:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8494A284CE; Tue, 18 Sep 2018 05:23:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 066772849D for ; Tue, 18 Sep 2018 05:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727139AbeIRKyB (ORCPT ); Tue, 18 Sep 2018 06:54:01 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:33617 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726254AbeIRKx5 (ORCPT ); Tue, 18 Sep 2018 06:53:57 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id CC4D519B7; Tue, 18 Sep 2018 01:23:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 18 Sep 2018 01:23:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=who-t.net; h=cc :content-type:date:from:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=L65w7kO8n6OIxZymP w7/88csyH3+lObLjNG488sACHk=; b=lsu9YH1897uJjMsdeImA5A7dX0ShqzuN6 VLjIZOmINPA3+srPgiJqLCzqSHUpe/o7bI8JpuiWNleI3MSFcE0IteZYmeMLu4yZ gkSE1j1ey7XpNxGw8mUkCk2cUs6J1KhhusnknOkVZ1xrh5zFlYsimSOfvgxqgREr cb4No2NZNZOSRaiAg9OGhBTkNTSnsCK+oQpK6CA7SzHojOQJu7JBTcrVLJjncD6i AJd6dntG6dcsRSP51+XsbE/9PmId62kQhxw7WMORXyb5Kd1snr4+53Nh1TCgEtyz Wumrsfwlkkn5+60kTnNrByEJAdhrKxWLOzE5091/269ILFhqDYLeA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=L65w7kO8n6OIxZymPw7/88csyH3+lObLjNG488sACHk=; b=iOyCOfdR 9oB1iHXL0SDgyr6oUY7pUAIhtc0ApctLUktbW9SAdlEfvQvKCUOowzSjalcsuGd6 E43N+QAq1S6Hgt/cIJ02zIMQxmW20j1Ulyhs1ZWZKR/iyiS2ma956FVZJCXPAU7F TKr9XgRFD0U3SMRGx90O/qQHQbApVbLhpMnbI7lbNduao7m59Edw1ZRh00bgaYFx vVDqzwfEjaCLnlNOwbWMdu+NuAtcPCngIK5+59ujPUh0zpM2G4gugNfPR2dDWJMR oT/J5XPOe/ZxIPZIJ3gphMeNiczCuWTkHwDf8V0ytLZPYKu0DxrlZMLoF2jAZ4lZ AiMKZsyVJyxqbw== X-ME-Proxy: X-ME-Sender: Received: from jelly (167-179-166-29.a7b3a6.bne.nbn.aussiebb.net [167.179.166.29]) by mail.messagingengine.com (Postfix) with ESMTPA id A95D0102D9; Tue, 18 Sep 2018 01:22:58 -0400 (EDT) Date: Tue, 18 Sep 2018 15:22:56 +1000 From: Peter Hutterer To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Benjamin Tissoires Subject: [PATCH] Input: uinput - allow for max == min during input_absinfo validation Message-ID: <20180918052256.GA23446@jelly> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These values are inclusive, so a range of 1 requires min == max. Signed-off-by: Peter Hutterer Reviewed-by: Martin Kepplinger --- drivers/input/misc/uinput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 96a887f33698..eb14ddf69346 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -410,7 +410,7 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code, min = abs->minimum; max = abs->maximum; - if ((min != 0 || max != 0) && max <= min) { + if ((min != 0 || max != 0) && max < min) { printk(KERN_DEBUG "%s: invalid abs[%02x] min:%d max:%d\n", UINPUT_NAME, code, min, max);