Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp400607pxu; Tue, 1 Dec 2020 14:18:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/kMEwE6LOP6ZYgHvu0O8popuz8m9RmSG5d78pfI9T0uZ71PrtFUDvzENnvY+BkEjVOK5p X-Received: by 2002:a05:6402:31a5:: with SMTP id dj5mr5286211edb.325.1606861093291; Tue, 01 Dec 2020 14:18:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861093; cv=none; d=google.com; s=arc-20160816; b=a19PaSgy8WR0F1u8lNcEX++NC1R7F8QcchW4h4TZW6IvK1TOlKLZE2z1Cg2CxJ+f5r ebGliZ8XlXs84uGfxvheb3WZ3RwtT1a2p49w2B50vxrdlFLr7nMQKiowdEJzT1I0TyrL nZsToDdkj8nvpW+ThruJPdF/oNPILx0WtZVOFsmgNGBoIfn5xBxww+9V6xUlSlQXwtQ1 g1Bh9C8LqBDhfcis7+1JzXSX6LGqYdZRIUpRJ2CPJM7WxHFnqBZ62nK4uCd8um/4a1Os JHt1kbHXh3IY3iXFEIcXyMI/quU5lNqUJfXrck5CzzEWedajlaHKJwSt8MGcuyZJ8rlW v/ng== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=q8dIwblUd3eNch+u0DOvZXpM40eVoccZJa4d2iqbqPw=; b=G4HT9eZzthS/LTWdU6V68Tu+DbKNT4kdnOdYDn2NFPEZXlkanmFTdY8fDRv37AQhEQ G2ngRYbG6YyuWMAlcXrD49++n3Y2fs92bLNV+4ehrXQ9vxxaVGXe0uH8V8Ln6Z8TcO24 cg8u49MirsTNp4Lwa+E34Q10jRKUesQZAIoImDkrIq147Gs/FLzRQKAln6Y5cbLGP/cZ ZHDD1WcVDZ4EcMo2HMb2fwAg9s3twnYNKZyYc2comS0QWqF1HIfsVmwa5I8yNxPg+AQp riS4FZeagRiVF/div5bam1q+2bdAA5/C5pnyjuz9PMd2Zdo/T4S0/FIxktMzyx/qZ003 kd4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fhvdi4mO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si199440ejx.330.2020.12.01.14.17.50; Tue, 01 Dec 2020 14:18:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fhvdi4mO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729111AbgLAIzW (ORCPT + 99 others); Tue, 1 Dec 2020 03:55:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:57722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729090AbgLAIzV (ORCPT ); Tue, 1 Dec 2020 03:55:21 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 6C98F221FF; Tue, 1 Dec 2020 08:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606812895; bh=cNppHkZnF3+Z7WHrTwu0Ms/zaJMXaE3guCjcVLUTt4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fhvdi4mOrb8JUipJwnUkTJvTm1COlmhDhsmr25bMrwwNdDXSt0MOg/Obm6nfUEwXY NVKhH+cPf7CScLGIg3cI65CFh0wbV3X3HQ18f5KXDL8M00MGbX1oEyXuG7BosX6yFs g8Pr6x2AR7+KOHDSleVUm5Cm8i6DfWVZqV62Pf+I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Ceballos , Srinivas Pandruvada , Jiri Kosina , Sasha Levin Subject: [PATCH 4.9 13/42] HID: hid-sensor-hub: Fix issue with devices with no report ID Date: Tue, 1 Dec 2020 09:53:11 +0100 Message-Id: <20201201084642.846849568@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084642.194933793@linuxfoundation.org> References: <20201201084642.194933793@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pablo Ceballos [ Upstream commit 34a9fa2025d9d3177c99351c7aaf256c5f50691f ] Some HID devices don't use a report ID because they only have a single report. In those cases, the report ID in struct hid_report will be zero and the data for the report will start at the first byte, so don't skip over the first byte. Signed-off-by: Pablo Ceballos Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-sensor-hub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index 4ef73374a8f98..7001f07ca3996 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c @@ -489,7 +489,8 @@ static int sensor_hub_raw_event(struct hid_device *hdev, return 1; ptr = raw_data; - ptr++; /* Skip report id */ + if (report->id) + ptr++; /* Skip report id */ spin_lock_irqsave(&pdata->lock, flags); -- 2.27.0