Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527795pxf; Mon, 15 Mar 2021 11:33:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZr/B8ISc/VS9dVLd/6R4R/RLG/T4rs72ThT848e6FaDnjBxeA60b5jf9/J0o+nBJpMYpf X-Received: by 2002:a17:906:66cf:: with SMTP id k15mr24840319ejp.296.1615833188482; Mon, 15 Mar 2021 11:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833188; cv=none; d=google.com; s=arc-20160816; b=ViKFRHJNzQDNTQWmAcqVAirKzkmKIqfSW7oMV6JHnKXmrrvYQGid7c1jh5B6cIX/VO KO1PlZnbVBgdjE7cYJjkgu2mzZ4bpzHjTQne9C0hzkTlpCeVR4/D+NbEma5b4PMwWuQ+ xwyq5gynorzQ1rbZCUqdy1OAL4bRI6bvf+I2eTH0GAfOL0jqO2ezuxuxU3/9T2JVBjgB Se4Niu24Z8/cv6qyjMO5rReYzdRwDkNQ3ryhOGvIMJwBhrXbH7EC43d09mKosRLBjUb2 /O5oCp61l/IdJK1mz8+jppwsW59RBDaVp/WiENnRL0FtREIJW4BjFEhoo5L76zcwCKLZ x8nw== 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=0UBrgE59wPbzJ0d2xuycg5pyiHM4TEsBrb36IB3CuuQZbV4LCg/4X9d8ERfyu+y7AU Kfa1NDglnAIdIUlHkkAjlKKBupLlIS6cuDAjjnJwUSetygGeL93y49i4JD0Xstj/iMWA FWSVVXJY+DhrTgSAUh1kc4S4+ml4mOYb6JgpZY1maHqbnYkpXAe2gHfImZi1Qe2h66eP iLkISoZx+mDzdRXhy8siiYhzr0ZCZwBi5sDCJrwn23vHYepg9k1+7LtNpb93Pf/JtqeI npBnnneuPn1KCwt7KLMuB62q4Nn/LzZt55Kh05uM/mWM7+mOS3Lj2oqLxkFEow6Lmygt KGoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HXm4CBiW; 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 f1si11954372ejh.95.2021.03.15.11.32.44; Mon, 15 Mar 2021 11:33:08 -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=HXm4CBiW; 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 S237306AbhCOOlX (ORCPT + 99 others); Mon, 15 Mar 2021 10:41:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:49242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233969AbhCOOCm (ORCPT ); Mon, 15 Mar 2021 10:02:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F184C64EEE; Mon, 15 Mar 2021 14:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816962; bh=pWVrf9WJrCrW6pcncVZT4ohTEHF2z1MMs/CPqbxUEps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HXm4CBiWA6ViBWF+qju2KqLg7nGC1dBWt7QrFFTr7XOqsmZJNivFUU0zDlyG8uadW mgBEigyjbLeBHidY0Dz5t/JCLQEbacmWGk4pUFOodlH3MEjWP6bDcrp9z5uGZlKIXN eySePeq1py+oLUvTfJdseCS5ecM44l7f4UMCnemA= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.11 231/306] staging: comedi: das6402: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:54:54 +0100 Message-Id: <20210315135515.442173147@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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);