Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527512pxf; Mon, 15 Mar 2021 11:32:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7FJ31eLFAdJe96EmrHqkGCqEaQZ5kD57Oi5HWYm+aBpvqE2eVeOZaE965kt85/fAVgHtD X-Received: by 2002:a17:906:a413:: with SMTP id l19mr25365768ejz.421.1615833167446; Mon, 15 Mar 2021 11:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833167; cv=none; d=google.com; s=arc-20160816; b=Lg49mkOqtR805I816X+6wg2eEbGVjGUAQfZc6uiBzcnMmZn0NhidKXLihckX7UbM/k Iyz45NkPpxacuOnnqnpBKyIx+7DEFHVgwCI+pSliJ3bmmgeIaR2dN6MMs6LJg2Tz0Pr0 kWwl5eSO3N8e9VD4ykVx7SCcVaIcAXsUI3OK6xJsaP/lcw84jipgjBeQVEVXXqOZu1+y DZlPN09qAvv36cmCAec3MwN8auPEbHRRnqHAwCcZlclP55ReZSphgr7TdFUhLQY1On8B +7N/HfcUANj7MFA8//TaMKvjHKxW2VMR0Y2ClzbZDLedmwfj9El2fLMG0sGuT6WqsT6G eKfQ== 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=L5nMrBU67To1rJVrxqfAegpBNOOUXUsBg56EaUoJEYs=; b=GADlu1Ca/DrtU1kSXSrNJJjWzVIIMTDVtP1FYTu0H0zuayHYOZPXifGboBqLbZPLkx cV3kW9k9JZsXNAbjySLtVg4/UJQMYxf4E8MdPV7nuVjjxOyTap/d9yxbFq59Ca6mtAhJ wu/sL+jsvu2PmBqzltJaZx/ZrHP1AT9SmIzLtsdgfg5oXosxyLQPCJBsZE/Tp8E6/AMV Az5z73Yin0NNCNh68bW3KVGaYkGnl24lF2IpwrCHkXyZtWMqhBcgZ6appTZSMvciX/R9 Ar4nTPiQ/y54cswR6NzgClAujSHFrrlm6AXT/gAfXIrWALPEeEjPCOi8XbhgUltANC6e jxrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ESbx7oZz; 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 hc31si11998071ejc.524.2021.03.15.11.32.25; Mon, 15 Mar 2021 11:32:47 -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=ESbx7oZz; 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 S238621AbhCOOmo (ORCPT + 99 others); Mon, 15 Mar 2021 10:42:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:49618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234335AbhCOODP (ORCPT ); Mon, 15 Mar 2021 10:03:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 01D4B64EEE; Mon, 15 Mar 2021 14:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816994; bh=Q+YjfkhwSTBDRku2nQrgouG+wdGpbcbrWoh9NCCjMvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ESbx7oZz4mzgSBBphwAJ2dT2CWpc2K3VHUo/1iyioLDI+75LbSkbugFIdW+G3EJKj 0a3J3HBtVo77MPe1aayjxL221OS2647fyjGWkKk+hbQg1OeWQVZYLxG1DAeavaxRcP vbeyugE9hE+qWpKZgTiEyayhJ+FQXptXhVfVuNv0= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.10 236/290] staging: comedi: das800: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:55:29 +0100 Message-Id: <20210315135549.958476416@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 459b1e8c8fe97fcba0bd1b623471713dce2c5eaf 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: ad9eb43c93d8 ("staging: comedi: das800: use comedi_buf_write_samples()") Cc: # 3.19+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20210223143055.257402-6-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/das800.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -427,7 +427,7 @@ static irqreturn_t das800_interrupt(int struct comedi_cmd *cmd; unsigned long irq_flags; unsigned int status; - unsigned int val; + unsigned short val; bool fifo_empty; bool fifo_overflow; int i;