Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3524418pxf; Mon, 15 Mar 2021 11:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhBVVFvRK4CGz55mi1lZV7bO84LtvpmodZq7MJZ9bv03/1VMW0KUcpq22TzrSwZSnbgvtN X-Received: by 2002:a17:906:4d96:: with SMTP id s22mr25206319eju.189.1615832920223; Mon, 15 Mar 2021 11:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832920; cv=none; d=google.com; s=arc-20160816; b=WW6M71NR8si85bwU2oSBWdFDeHnUggcOGsvQAabj9P6Il9QCo+BcSDmous+DvDuS4S ClpkQvhJg/nNBkNPdxgdbWX/dYS6uxlOyTVjkqnSBmQjOyhwlTN2esytPQatiOC/0IIl oJ+SgbyNXGtU22PhXLF/JetbScAkLUeH2VCNNATkrR3uacxpJCBbAdhYAaGpiK6JorTO tw2t3XHzGJU1TDM46ZNTC0yAKOa+UaDb9IkrnfQsB+NQSIYAT1UkfxcEJrqoBoK3kDaq hEL7LcizOfB0ezjxjt2DPY1OooGZRYTFj7ipzTrmFAyz/qzvgeuNt+3Ykw3u1m7EeZdr czoA== 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=zewVWm4QjdJ93MDy3KamGY6CKRwrUXYIyjvc0Ju2TRw=; b=oDhFEO6rc9KfMN9mt2zSpqPB2wFxtTdD4uenlmutxPXwtrbdNKOc9vDHDsbRg1cuv2 vdaPdjjYAw3DmgqYKhFYb5H73Z507IywkCUiTn672X4HweHvjLvqwumtJsVB8DrnUmJN Kp3oPPzxHQTvVTIAlOEuPjhgHM+YLe54WAq+Gz2WqDOfhjZ3ykDj4zgDMVAuapKxy8PP xz8vPpZCtbcZzArh9IKYUqqOZGgp61CVSABNtfFr9LgcCgp3eYTg8es0v9xZWHmYLCgK TkUgS0Dkl/XcVNWftko8O8K6iWK9SEOXsWiFo2TCjXUuqxAV623eQeNwYkfBoUmHKj08 UBtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=upmPlyUI; 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 c1si11220034edt.469.2021.03.15.11.28.10; Mon, 15 Mar 2021 11:28:40 -0700 (PDT) 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=upmPlyUI; 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 S239239AbhCOOcF (ORCPT + 99 others); Mon, 15 Mar 2021 10:32:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:37500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233214AbhCOOBL (ORCPT ); Mon, 15 Mar 2021 10:01:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6F5D564F0B; Mon, 15 Mar 2021 14:00:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816838; bh=P2QOQYIZikTPjf1XFpcVc68IDWfLnmcVV5erqVDP8Jk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=upmPlyUIco77kDeQR2tmN+H3Yot3XhdCXch85CiyPm3k1ZyVDlvSjIqknAbkWRWDt lfGgyAq2arWRku95gxBKhcLkfn8NKaftYihJVskyAZOJBSfPXnI1g0kwnsq+FqZIq2 TckVp8Ep/3XgB4wNjrNCFU9s7VoWzobgZVzyu9C0= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 4.19 103/120] staging: comedi: pcl711: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:57:34 +0100 Message-Id: <20210315135723.347811803@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135720.002213995@linuxfoundation.org> References: <20210315135720.002213995@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: Greg Kroah-Hartman From: Ian Abbott commit a084303a645896e834883f2c5170d044410dfdb3 upstream. The analog input subdevice supports Comedi asynchronous commands that use Comedi's 16-bit sample format. However, the call to `comedi_buf_write_samples()` is passing the address of a 32-bit integer variable. On bigendian machines, this will copy 2 bytes from the wrong end of the 32-bit value. Fix it by changing the type of the variable holding the sample value to `unsigned short`. Fixes: 1f44c034de2e ("staging: comedi: pcl711: use comedi_buf_write_samples()") Cc: # 3.19+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20210223143055.257402-9-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/comedi/drivers/pcl711.c +++ b/drivers/staging/comedi/drivers/pcl711.c @@ -184,7 +184,7 @@ static irqreturn_t pcl711_interrupt(int struct comedi_device *dev = d; struct comedi_subdevice *s = dev->read_subdev; struct comedi_cmd *cmd = &s->async->cmd; - unsigned int data; + unsigned short data; if (!dev->attached) { dev_err(dev->class_dev, "spurious interrupt\n");