Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3528173pxf; Mon, 15 Mar 2021 11:33:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrAs+A4h8BDjaCwoFDN2DAqvg01/BjRzjWiHDQopM4RHRvjqn4u75aLmhkvPiYp3lcPD5O X-Received: by 2002:a05:6402:312b:: with SMTP id dd11mr31709902edb.149.1615833218182; Mon, 15 Mar 2021 11:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833218; cv=none; d=google.com; s=arc-20160816; b=z9vYBcjjBPVXhi1wm2AhNgVZXFsesDGPJu6aWkjwZcpOnnmTB5fI6MTEQ5E9qjeTDd +Ma+Pxm2N47bzQeYxRClWeOyAzxo6pWnk9H1zlIoB5PV8k4gJomElhR7rZ27AfvS4mLz AAwhWHNi+absImjJCGpACLNKSE5nASY6gt56M94yV5g443NpEWlkyIaypIkmzo8h4REa Dl0ZzsFgt5D+HqPt3EzkX5DvxrJIXWiQseH71Xea61rgZAgQiN9Kz2kIsYSeQfsFA5ST JHpMO8iMnLLorK5ZdE/3wlfblkgZIV9JMCT1YHCftPne0L7fs/jw7f8x2kC8h3wTi5Sc krEA== 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=0LlMowrcSDPUJQ6FiOMp4cD85jXa68nhMx7eOTnByFWB6333+fQP7nvl67m2YUB0vj 3DFtGOd6G31q1JfXE/u17lY0XENQP73nUjwEv6AOrm4kgCBbf0rqNYhj8IGwNTPB98C+ sxqZWrQUdKBgHZ6RU68Xbg2IQuF8BZGgTNtWcOL0D0KSSx1iHx83Xz9ivWHTG8ThdOZF lq/E1dlGVOddTSRLDIgGnz8PeAuCeobneKWKpdQm4cpt2Pldq7fSb/3lwJgeH+WJ/onS jeL7G4xATEkJSn9UWp3EMEWnY+2806Z7nodB1Y6OW5CctcZk9vk2YNfoQXbkNBMUabiZ J+aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xi87fNPx; 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 u27si11163470ejj.726.2021.03.15.11.33.15; Mon, 15 Mar 2021 11:33:38 -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=Xi87fNPx; 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 S238753AbhCOOmv (ORCPT + 99 others); Mon, 15 Mar 2021 10:42:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:49662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234404AbhCOODT (ORCPT ); Mon, 15 Mar 2021 10:03:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F3D2A64E83; Mon, 15 Mar 2021 14:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816999; bh=P2QOQYIZikTPjf1XFpcVc68IDWfLnmcVV5erqVDP8Jk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xi87fNPxJ6R6XVBJXYxvL1aal7miuYdIvRR/ixVVJ3Mt28FYocmXzeufELNtwufm4 w9WiZhKe6JjfaqppeRBjektVR7avOMdlCQTCLflFHiuljdpYGr+ZGVCs9uFr/9rzkx y/8JNut+cDQBcA7a/0GruUw9eyKH9P1LglSFVxHA= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.10 239/290] staging: comedi: pcl711: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:55:32 +0100 Message-Id: <20210315135550.070497091@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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");