Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3526004pxf; Mon, 15 Mar 2021 11:30:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz78tlQ75pIUFjoTGpSucigTsSo1bpDJeudiC3ywMSmqv5BwOGj9fd+KcOVQ9T7RyHVtpNG X-Received: by 2002:a05:6402:2ce:: with SMTP id b14mr31526992edx.13.1615833047066; Mon, 15 Mar 2021 11:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833047; cv=none; d=google.com; s=arc-20160816; b=zsyPX/QkVMDng199Nnd6xcI2b1m6DXsIekLazVPOyuluuzr3nrceLQZDHXw18gcqxm EmVpigXgnCRXFqYsRo8x4cmKgBHI0WA562E747ZY0C0OAtIwoeNrv7wT+C+y17CLRQ2Q 120OJUDj+E2dLDdnMWABHPT86GbGCrcZWgAIyEOUZ/pIUvaR3WHF1q2iV3nBI9EURYM4 I0pJ/gcyE27b8fOGN4QvMRWAmjJVE+8lvD3leLOFNIv0zDP5he4moaOm5DlX4IZPcV6h k5FyadwtuUGdR8qzaDOb0mN+vODONzRF9PrsxJUtbsDncdOZazuVfIDLnC8hvOqISZiZ 1S5A== 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=s1EDPI6coMU8+7yrJg0o2iOWJcPz1LN1AkScr4D6aUP6Gof6gMaFBi8OMjEXl+s7io kS80CPOFMBiOUzQv7Bll1kDGXW3JS8otwzSJ6licvZdS3UvghNKhkBEEvZC/e+ivQRn1 Woy+xohRj197JlS4ortvapHhTIVjItVXoCS+B5doAfkvHvXJdWdF7Q/5+rD8EeaLlIU6 nKxFloAwQroS8xjgNbv4BiVouvkNgF9Wf5U8uXR7TczBaki+IraNGrnl9UxSdk2BQu5G e/NnhKoLwpnkRrITkjgfUUtqFG9uZ10GlrOtfw/fDCxXS7wqqMsXB+ZJfDamyyNzVnOS vbCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uGeEi8Xr; 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 a5si3833988ejj.325.2021.03.15.11.30.01; Mon, 15 Mar 2021 11:30: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=uGeEi8Xr; 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 S239759AbhCOOdB (ORCPT + 99 others); Mon, 15 Mar 2021 10:33:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:36594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233152AbhCOOAy (ORCPT ); Mon, 15 Mar 2021 10:00:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7581564F75; Mon, 15 Mar 2021 14:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816828; bh=Q+YjfkhwSTBDRku2nQrgouG+wdGpbcbrWoh9NCCjMvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uGeEi8XrOJldDLJX5+MA6dH5XyOd1KnzK3FQlooiPcha2ahAxVMb8TUdmOoy/E5Tw PtwfKkHz+71dTuJULK+hnP33Yt6kWAekHuZrQIpq70PVmjAosshHQ51sJwPIXQGp5G yFpoqMh3fCDeFjjM6EoEIziS+BTUcqxABG/Oxxjk= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.4 138/168] staging: comedi: das800: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:56:10 +0100 Message-Id: <20210315135554.873381287@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@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;