Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3524357pxf; Mon, 15 Mar 2021 11:28:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziI4RQO6IW7wsbZFVPVjs2v3fo+N4dspI15kCAJO0y9Vn7+hI6u5QfYRcwtxvum1LhG+4h X-Received: by 2002:a17:906:c005:: with SMTP id e5mr25281092ejz.270.1615832916045; Mon, 15 Mar 2021 11:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832916; cv=none; d=google.com; s=arc-20160816; b=umIvEQgjumc8cOh6uEbnzSr9Nj94YvWMCC2prPkILIMf5q1eTxh6HYbm+YF159ldm0 OXoYbsZVbhHupk9aFkdCBBGkldNhJK8MYCAvEdzDd7P1WQTedA0v+KHYNRP8u1Tr6Hem 6AtTYUZ+WauMZL/o4bErbwKHP7kDGl/XASYYOpSsfHEnjW+swR1gfXYN1G3Tr7pn7TQw 5gMIzLM47ssk7t7DWOHX1yXC1LCjKL5dn0sgsVLDD+gntQ2kayAWjjfoAbqVg7IDN4fR b4XQ2AvRzp2zh7Wb2RxzPjKX3n8lYLSZIJ3O9ZSjjkDJNvJSeRHs1cJ1FknjXmnbI3bi /UxA== 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=U1VD6iyIU//gC8K0/tjlIWeZ5cjKa3tNK+YNpmFGODI=; b=BDY6S0Pk/7pMbUswLCyKRW4NJiZ+BTZqPqjdXEF+ML/6GDFTD/OgtEa7BEziccIsOT l3YQyU3X7gFKVaT4dm45eqIswvL4Jv9/zLe1rcJ9qdrCSoeR7l+IaYTX3HSyYSyJgASw ZNl0OJ307japXwhq44zJUyF3540qEiXoxintWICn0jQqNcWwkFsVTYKlR689aFw1gGop bT9GywlDKLNGuQwBqF/yc8iN694+iEHtzWdpasVyWC48CWQhQSCejBQUYAAJaBXrgSeC bdBkWgH2ALkNeaafGBq1kWO4s2YZ7XlYS+/os+bzqoPQrfhO6RTxf1GORQXUrRqCPTZD mh8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AK15hNUw; 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 gs18si12388891ejb.648.2021.03.15.11.28.05; Mon, 15 Mar 2021 11:28:36 -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=AK15hNUw; 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 S235412AbhCOObm (ORCPT + 99 others); Mon, 15 Mar 2021 10:31:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:37582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231918AbhCOOAv (ORCPT ); Mon, 15 Mar 2021 10:00:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 06E7E64F80; Mon, 15 Mar 2021 14:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816827; bh=pWVrf9WJrCrW6pcncVZT4ohTEHF2z1MMs/CPqbxUEps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AK15hNUw15+omiHSdMS8c8mfuScNfRBn0dWn6Oam9X/fe5GlP+Kh4YiFWFy+ePm6j b9BARSviKoJmg9chdAXW7rWqZ9M9C7+qS3bTxy9X+lcAXDp7/P2HoUK+bLScaAVLC1 WL3xeDBlm1ThcUmPaXSSP3rokdBbYaf+2fjZT/SY= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.4 137/168] staging: comedi: das6402: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:56:09 +0100 Message-Id: <20210315135554.840760294@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 1c0f20b78781b9ca50dc3ecfd396d0db5b141890 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: d1d24cb65ee3 ("staging: comedi: das6402: read analog input samples in interrupt handler") Cc: # 3.19+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20210223143055.257402-5-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/das6402.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/comedi/drivers/das6402.c +++ b/drivers/staging/comedi/drivers/das6402.c @@ -186,7 +186,7 @@ static irqreturn_t das6402_interrupt(int if (status & DAS6402_STATUS_FFULL) { async->events |= COMEDI_CB_OVERFLOW; } else if (status & DAS6402_STATUS_FFNE) { - unsigned int val; + unsigned short val; val = das6402_ai_read_sample(dev, s); comedi_buf_write_samples(s, &val, 1);