Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3830791rwb; Sun, 9 Oct 2022 11:54:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SIH7KXP/Jx2jnLNw2OcD5m+9DuZUHvFf1tlOxpYjc/socoRo/TYeneY9I8a5Hee33Cxg9 X-Received: by 2002:a17:90a:6503:b0:207:cd0e:bf1f with SMTP id i3-20020a17090a650300b00207cd0ebf1fmr16956565pjj.25.1665341643671; Sun, 09 Oct 2022 11:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665341643; cv=none; d=google.com; s=arc-20160816; b=lzx6RKUsAFQ4kth2/ce2qrFc7NOD0uwg/66ZRtcqQPMpqi/ICLjVeXBpA/k+bPiVEv a/y+eoOxn7rnmL2lHjdcwdc2KSahrl3uStAJfD8UxhW8GH/qZmfVQnQq0DjX2GGD8YLF tn7cPLsgvw7rTWvhdEO1eJWySBGHTcdExRCaWrEtmgSlVhE63Evs8BaCwrN0l+UnBMGr CKsEJnJwnRu7dZhkf41jlPhG15/g8sV0ElYS2AZvKiniohnUi+ozsUlNI78445yFbbuV t2fpiH4lR6av7vUY+5v0N/nLGB3rwQ+f/6BxuDGfAOQ5Z9NqfOsPC0ZLLeJvCF5KuwkN yAxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=PS7csLc85uEKkCZYUniKkURfmvYd6XN26COmZB1Jdxk=; b=M48dKLYNSIS62GGwqXTEyj6i5YxTU1H2nwD3UoyDWXfqPYH9DbWguaCtRrPTk20X3O 4Qu/1WQdw522LyXgvz3B6LVarGU95Q39vzHAwO8g0sat+4OzDTK/BXnCga4QSMzaXh9l ptetrZ78aKrC3IdpdFhGBPL0NzxI1lnNX1Ih5uCQ3MITTf7Fyrh/8soi1XUs0Ne4DBjV F8GUv9IZKGNnowFDtwvNEYfvi7twwlJpXVMFlra74nfDnP9gK3wG5u4MSturWZmqpUaI 4AoKWMjfR3aoDPe2LF5vC99TsLgrMfWiS0m81m8zmLRAfPn8aTKectSDD0+19TCUmpn9 V44w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bR5211TQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a170902d58f00b0017532e01e57si9279038plh.200.2022.10.09.11.53.51; Sun, 09 Oct 2022 11:54:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bR5211TQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230237AbiJIS2C (ORCPT + 99 others); Sun, 9 Oct 2022 14:28:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbiJIS17 (ORCPT ); Sun, 9 Oct 2022 14:27:59 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 606BA252A9; Sun, 9 Oct 2022 11:27:57 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id bi26-20020a05600c3d9a00b003c1e11f54d2so4096501wmb.2; Sun, 09 Oct 2022 11:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=PS7csLc85uEKkCZYUniKkURfmvYd6XN26COmZB1Jdxk=; b=bR5211TQJ7TQMkrPhLKq4irYkXEil3oZDmp8K0EJ0hNJFXV6CIAbLe5DRrgMxrJtwm DFZ1F21o8t8l3mwsh3tV22Q4QBsPF/XbFkMQedPI4miubgUHH7zyyuOnR1NXhKDnkzZe Q2HBbMBd579Fx3qHI7NcuGAfQmfybaATC8GQcYKdcRNKns/rBPQV55a7R42OwyvUNUdp Ms1FZAG+gq+AEFp2q/BOwfCUv/+4YdzbkS4stiqY4Vpeip0TVSY1BOxeSYjrdr3yIAcr hKGA/v6PR6Grcq4lmsouBTO5L5nWzzQdP6cXno0aosv9YVHL23npmXS61OXSC+EQ5OYj +0uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PS7csLc85uEKkCZYUniKkURfmvYd6XN26COmZB1Jdxk=; b=7X+efpA8gHYXywZW2JzaQdhudlwgx8v5RHNFMSgQY4MsC98/2Hsyj8YMThSzPVG8nX jzSYNV1jvXpThCmMzgEKQl1MUgevg94AfRYDbdvdSAAGtBn2LosDZ19kgbhn+2ZasSuj hnvTQKu/TzNBrJ9P8WuKawr0ZOM2pupGnjvbibqOlEOuVp8QZwvcten6XldN24L31XH1 6DHOdTYTTFROS2/5Jisr7iOc1Q7GpgaFj9M7gtJ5mcheZb6dXlAQGEXZv2yEiqxcJ0dr Np/wIikkru7keoyojh6V7Ti04Ypyj9pXexEfd1Xe4wYqMOX7UQ/OEjGHZ53bR68R8pdk Z9sA== X-Gm-Message-State: ACrzQf0tGHB6GSLJXNWC6aNGRxvqvQwPpNFxEWYeF0YEskxxOcy7h1e6 0b2F0zbhpXiSfW7IAlC/kHM= X-Received: by 2002:a05:600c:221a:b0:3b4:75b8:3f7f with SMTP id z26-20020a05600c221a00b003b475b83f7fmr9927436wml.175.1665340075581; Sun, 09 Oct 2022 11:27:55 -0700 (PDT) Received: from localhost.localdomain ([94.73.35.102]) by smtp.gmail.com with ESMTPSA id d16-20020adf9c90000000b0022dd3aab6bfsm6909438wre.57.2022.10.09.11.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Oct 2022 11:27:55 -0700 (PDT) From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, rydberg@bitmath.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= , Nulo Subject: [PATCH] HID: magicmouse: Do not set BTN_MOUSE on double report Date: Sun, 9 Oct 2022 20:27:47 +0200 Message-Id: <20221009182747.90730-1-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Under certain conditions the Magic Trackpad can group 2 reports in a single packet. The packet is split and the raw event function is invoked recursively for each part. However, after processing each part, the BTN_MOUSE status is updated, sending multiple click events. [1] Return after processing double reports to avoid this issue. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/811 # [1] Fixes: a462230e16ac ("HID: magicmouse: enable Magic Trackpad support") Reported-by: Nulo Signed-off-by: José Expósito --- drivers/hid/hid-magicmouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 664a624a363d..c9c968d4b36a 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -480,7 +480,7 @@ static int magicmouse_raw_event(struct hid_device *hdev, magicmouse_raw_event(hdev, report, data + 2, data[1]); magicmouse_raw_event(hdev, report, data + 2 + data[1], size - 2 - data[1]); - break; + return 0; default: return 0; } -- 2.25.1