Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3525554pxf; Mon, 15 Mar 2021 11:30:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEsYim/9R9Cd4vVEkTgMqq7KO7lJ1L/EQxZPqEcjffG/3dG71NEFKltjDOEo2u7579q2Az X-Received: by 2002:a05:6402:181a:: with SMTP id g26mr31456422edy.225.1615833013204; Mon, 15 Mar 2021 11:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833013; cv=none; d=google.com; s=arc-20160816; b=J/oTr2A+TKlUROgn9iBfTlsXybG7klKTqe0+qY7Lir1GALARrdKia5hSkR+AYdzYXC l7opVoSVuLcscUl5TPLhLKFYO3pGQEsCyHpWjV21/RvoDEVwQEqLmKqzelLaDH0xOA1E f2ByNYAYx36UFnQfCEL6eydZHXaEAtGowdPkOWy9IvO7DknGDIstp6BAC2a1RF24xyyH CtsUdTHTPJexoHN7yxAUS5kAOU/5b1UeCYT78+7CF68c5I3MdUoDKpD9OU4GhLGFj/ll MbgNGsynjYrVC95ZusL4ed1vYfoe+9K1zAfnYEaK/v0N5DlTePsy6MAYA2SWasWQ/RDR ZLtA== 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=NzjTDTjqlYeL3kijB5aTNEBtinIInp4DI5mAAJeY23n8XbiEoxbIAa+S7Lgzew4GtA o1fUueIo9hGa3GRcy7d7TzgLJU4SizGQwrKyQq9QZDwR3raFpPeEHEKjG5pbehjZtOmX RzumYhy+ssaJoolbRIrB3uiyTm7BnJcvDeiEYF/8YAXouvUDbJSAFZFhYK38jSUjvD3L xoCNRUbPiYpxdyXou+tzEIYvd1b42/Vzhgl0NHq42IHvdi/J8RZE54OoQomml4VYYMQp bjp3J1wfPjkKNFaSqCe+mi67+x0S+/z6JyrSLhQ+eM+hnyV3SsfwH6GGpMBq1czp/0Hn 8O/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WqXGDvjl; 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 y12si1792954eda.74.2021.03.15.11.29.50; Mon, 15 Mar 2021 11:30:13 -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=WqXGDvjl; 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 S239493AbhCOOch (ORCPT + 99 others); Mon, 15 Mar 2021 10:32:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:36764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233200AbhCOOBK (ORCPT ); Mon, 15 Mar 2021 10:01:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B809C64EED; Mon, 15 Mar 2021 14:00:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816834; bh=Q+YjfkhwSTBDRku2nQrgouG+wdGpbcbrWoh9NCCjMvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WqXGDvjl0pcznZDiK5HYCybYKl6Y7MPHCLNWTdKtfCgiXf4gXzG7wK7k4QWdwu1eD c6aKr8t49ZiolTFv9WaVrzmY8ppcbWBgI5St/hz10TF+CIlZ5DeUD4oPwH6REE5pPx WxxgSDltgKMdkG/duJ2SIB7tiyLWdOekJknx2fqA= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 4.19 100/120] staging: comedi: das800: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:57:31 +0100 Message-Id: <20210315135723.246504260@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 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;