From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36129C76191 for ; Wed, 24 Jul 2019 20:14:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1A4D2083B for ; Wed, 24 Jul 2019 20:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563999242; bh=yiZ9pOZGT5BeYCzC5pEJPnOd5W61unRHudr8ncgMJ2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CCSEo+E6sV8jNtuy6t0ISIPvpyLzE5IYsx7S9w7wACSTkdid8NjqTNwCnWtgZOZHu oQKjE/x1hRxnoogdxghwno+Ccq/Zj/J+6rqD/261cZLvLJZkKQVZ09HyGhwXIOMtwH DzNpl2kgOAmBFM+qXbjrQAehifCLqmTp2aV6FUAA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404450AbfGXUOB (ORCPT ); Wed, 24 Jul 2019 16:14:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:39836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404563AbfGXTzw (ORCPT ); Wed, 24 Jul 2019 15:55:52 -0400 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 4D1D5205C9; Wed, 24 Jul 2019 19:55:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998151; bh=yiZ9pOZGT5BeYCzC5pEJPnOd5W61unRHudr8ncgMJ2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lgTdK/QgZuCqqFz2WmjERI+WscFu6VrN//rXNgLO9hIOaV9dZxImFSdCjtxSqEWhz j0IJSNt2JXsSpv3RGNGmQ1vgd6ugEli5+YdIoWJ6tXVO+mIBW0xMPWlpc25eKFHIth O9F7mrY+ao0Zhby4uwdt94BtwiJWn/RL4G4kMowQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hui Wang , Dmitry Torokhov Subject: [PATCH 5.1 265/371] Input: alps - fix a mismatch between a condition check and its comment Date: Wed, 24 Jul 2019 21:20:17 +0200 Message-Id: <20190724191744.333685619@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191724.382593077@linuxfoundation.org> References: <20190724191724.382593077@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Hui Wang commit 771a081e44a9baa1991ef011cc453ef425591740 upstream. In the function alps_is_cs19_trackpoint(), we check if the param[1] is in the 0x20~0x2f range, but the code we wrote for this checking is not correct: (param[1] & 0x20) does not mean param[1] is in the range of 0x20~0x2f, it also means the param[1] is in the range of 0x30~0x3f, 0x60~0x6f... Now fix it with a new condition checking ((param[1] & 0xf0) == 0x20). Fixes: 7e4935ccc323 ("Input: alps - don't handle ALPS cs19 trackpoint-only device") Cc: stable@vger.kernel.org Signed-off-by: Hui Wang Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/alps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -2879,7 +2879,7 @@ static bool alps_is_cs19_trackpoint(stru * trackpoint-only devices have their variant_ids equal * TP_VARIANT_ALPS and their firmware_ids are in 0x20~0x2f range. */ - return param[0] == TP_VARIANT_ALPS && (param[1] & 0x20); + return param[0] == TP_VARIANT_ALPS && ((param[1] & 0xf0) == 0x20); } static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)