Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp401050pxu; Tue, 1 Dec 2020 14:19:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1uw6IpoyKgo1E0E0SKr6T9igK1Vgd87B2hh4qSN6q2LN3T0VeJAPMj7RGSENfSmkLBzfv X-Received: by 2002:a17:906:7087:: with SMTP id b7mr5039026ejk.70.1606861142592; Tue, 01 Dec 2020 14:19:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861142; cv=none; d=google.com; s=arc-20160816; b=d3ANpt/ZX8TkkH6DzC/qCTSphQ50T9PYLhSLMT6zMXOxrVT/IR9580lyzEafPH3I8x hBZ/2Ih3NO/T2iDC7wtkRhRrE8CAbqOklkIw0xmQCGVH5Y8olF557he4w7YzXoIPYr2b NKwC5dhlbKj0UAl2UWStQ+FViVngReQDvn7/I8fPLybOVtBgzZJrQpTJ469zkWbmNfI/ 9chPS6O7dOvgJIIX9ohqIVax6Dt+hgWT0ht1li8dNrwC6Ifxxs5bdrHpGvpC5+iAyP5h WUBH9S3cjpXRIOJ96midv6zfboDZsPEHIxuz1BwjkJ7gRThcQVteUdSVPoCgzeLSzSkp rqdw== 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=7+ISiS4XgNOp7iekH/meGSJyiVm2DNkGJ1cbBlGw20w=; b=xBSyIBPG0aEMoQ11+53MPlY2F27gq0rhWXTFfL5znoNG8h3rJolpR9dHtIdmgpZPEj rtyNLggEXMD5ADDX3aFpfYtdIh/nga28uJ4qiv2nz81pherF7TYRAlaVAubVwWnIHUB/ eWi9PdtMC+qCL6eyVCB5+vRtJk4OoSV3A4jXukuGdn5zD+DlD23ukm83f8uWBKb+aMit FBGyZH3TFMTkITL7nDoNJqSR0l64YGDy//tnhVmF2lLUJt52fVqRssuIzRJ459QHhJQ+ w7pAy3DAut9/Kl1xOy7DPVEhMMFIJdOl0O1jjmbi7IY4Jayr0SfnMScr63GGSoW1Gkk2 +b7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wS1b+V/C"; 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 bu26si755542edb.284.2020.12.01.14.18.40; Tue, 01 Dec 2020 14:19:02 -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="wS1b+V/C"; 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 S1729228AbgLAI5r (ORCPT + 99 others); Tue, 1 Dec 2020 03:57:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:60560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729010AbgLAI5p (ORCPT ); Tue, 1 Dec 2020 03:57:45 -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 D6440217A0; Tue, 1 Dec 2020 08:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813050; bh=MD7qjpm33Nehn5zcoqnTWe5lPG286RmzvYRMqO4sZhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wS1b+V/CB5bRWmxfn0Gb3F5I651F7U8RbUW6nE+XS0ZOiF+ecWEPbEUZWfW5ZxMLc TX6DIHca4ERyJIghDc9VQSTevD37v9dLJ4/LltMLZTTe1DOPE8ZCMWsERBJzwmAL8m 1TULQDfHZdn5fVHh9WNE7Xa1dagP9VtOK5Sa2VNc= 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.14 16/50] HID: hid-sensor-hub: Fix issue with devices with no report ID Date: Tue, 1 Dec 2020 09:53:15 +0100 Message-Id: <20201201084647.174738010@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084644.803812112@linuxfoundation.org> References: <20201201084644.803812112@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 b5bd5cb7d5324..aa078c1dad14f 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c @@ -496,7 +496,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