Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527518pxf; Mon, 15 Mar 2021 11:32:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHXBLw0BloU4k229RbyTwnw1c8lrikBeDlVd8h0AMRRRYXnuhJaAoQp0hn/6r49P4aNBCu X-Received: by 2002:a17:906:18a1:: with SMTP id c1mr9184725ejf.62.1615833168077; Mon, 15 Mar 2021 11:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833168; cv=none; d=google.com; s=arc-20160816; b=sOgKlBnhgHpeCza/SxJLPNuAirLLqLQ/7WB/1ThnU01KaAErE3/y8xWmH/O2AYJ8xA VEiciGWRHyur3I6apHPDsdOBTtEL8XEwaExEpqHqwelj2x6CMNA6gF2y/HK243dbfE1v NbmgQBeMF5OoKxpoPzeEqaXPgjkZ1+czth1CzsX+BXWX5du4jID+1hXH16xQHREoKznw uB1E8678J6Sp2Nfi/wwwhGtlQr0R+XpEnu1jp0LEONZPQb5oIKU2WYG/ZQziwlCn3VzM HFygrHbwuGvmJyVL1NA9FiROaPU5KNFLD1fF7KyTz92S0mQYiV8N0mJv63H771JCyY4p x/tw== 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=bA/VTK+ktEdhWPaqcRuKLyVn6Emrmh+SSq1vanV/ammF5eJ9Zg/XK8PaNiR2kDGRJv g55Z9NVGi2/0+y4t8P29TyZ/rh5dkOkDQ3tLCMWVyb+QHJi0nrOuu5gz2AYf9tLzWQEp N48Igqr247diQTTgElodJQ8k7HA5GaimKTe0Kw86KPuZ9iKdv1u+C8hGa4AjTijovdAH LmmgL+RscomwVjIRLb2EO9rCqi5i/3073csZVBr76zHJWU+FMzR+q7iwe9SO8oHDic3g tFtp+TrPMjv5AkncHoVArAMXVqVQZBkY09kApyj85lk7snCrNnjKiSLPHGvnamf8lL0Y r8xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="kTTlY/hx"; 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 k15si12429890eji.582.2021.03.15.11.32.26; Mon, 15 Mar 2021 11:32:48 -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="kTTlY/hx"; 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 S238656AbhCOOmp (ORCPT + 99 others); Mon, 15 Mar 2021 10:42:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:49602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234323AbhCOODO (ORCPT ); Mon, 15 Mar 2021 10:03:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA33764E83; Mon, 15 Mar 2021 14:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816993; bh=pWVrf9WJrCrW6pcncVZT4ohTEHF2z1MMs/CPqbxUEps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kTTlY/hx08SWdKpb7XMEjZchyyMEUYaxdjbyxAm7H2BFC7dAXwzLat7iaoI/JEJtH /VgW4MgyWt4AIjhERDNMWC5HWK8s8qC11Kcf8uzJSeMcc0ADJLYXWwpNMULq/AHMb1 x/3aqLdhloBJLo6EGdKTAmRRhIeIJtDpNGwLIf1I= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.10 235/290] staging: comedi: das6402: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:55:28 +0100 Message-Id: <20210315135549.926201910@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 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);