Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3525147pxf; Mon, 15 Mar 2021 11:29:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZZ5zfKLITG8dDexHZaqcbBLoacZMjQeqRQxNH+vZeVEMVOLStrd/YguiINM2FZ2gHdOa8 X-Received: by 2002:a17:906:8a65:: with SMTP id hy5mr25743138ejc.250.1615832979335; Mon, 15 Mar 2021 11:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832979; cv=none; d=google.com; s=arc-20160816; b=pUye5xpK9AS7VWZnj7Lync9kCJSW6EpzspkfMhDJZtIX+nK1duX0qWeiw2e7Ukv75D BiOT3nmsonZ58RUTWx+Vh5huPO8D4kNETKpk3sKkfv63y/cdw25LC7AfkwYWMYdeTmLF H2frJIxsLPBbPDvZ5ewe8U9xvkvLIH868MNGouDlOVR/msxoABi7eFwHv6hkAjFKNO/A R2QBCerv1tB7KdVkHtbhtgB3qrqKVLBm/qvyawazrdDcgfMifVM75UHfsndxzkKve8Nc DJa7afezEx5tBNyI4AGb3DssjMzjjwue2eCYIVl1sto8ssTPpLfB6BUWtm8YwblWszpe diBA== 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=kZAsPauc2oOnQOLX2aEWnXMJSB36scn9wCVRFfCCDps=; b=tisvNkO4GE/ql1u640hNoB6LRliogCC4RQiWA8CsKNacX+/oLqqtkmizVQq9RYkIhV aRXi42I3cg35hHTeLHCtGGhi2yyOeN5f71sVbphirSU395VhPoyFCEC1WZzCNJptq591 lUZijcQTucpTR1wcKDkIKyFR+5oLhJBNdr1hpR45vzYTiCZIB3fdn1QD0xWIrJSPSrwC VWp/FfE3gSoXEHxls8rKbPHCHxBFLsoKJjfm7IxR365m2ji68R3T7BAaxQBhwck0T+6p zDG1EgsbEhYxSu/CylYCnyknkHw4qabl/bVzy6gQZPekTotHgscTUG+xjR82Ngl79Upf hL1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ZWbeTXh/"; 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 c17si5836889ede.535.2021.03.15.11.29.11; Mon, 15 Mar 2021 11:29:39 -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="ZWbeTXh/"; 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 S235529AbhCOOa2 (ORCPT + 99 others); Mon, 15 Mar 2021 10:30:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:37612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232109AbhCOOAn (ORCPT ); Mon, 15 Mar 2021 10:00:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2620864F94; Mon, 15 Mar 2021 14:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816831; bh=+U3DPYnaAU4BV6e5NzWqBd35UHJisgfIAbZ7CIwD1+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZWbeTXh/Jl8zjj3Cd7BxCmgR4loBpy3F/KHzDPYE9YMwxbuLpz0TsiYbPdDgYShrA bnYRUJx1q1Gic2W95g6dgFTrfUzoPp2gWWrVzItxixdYacNTNo7fPSBQGXags+7r6m XukAxu7uR2aih1VsMbOxQBte0JAks/oY8vb0BZ2A= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.4 140/168] staging: comedi: me4000: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:56:12 +0100 Message-Id: <20210315135554.942483104@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 b39dfcced399d31e7c4b7341693b18e01c8f655e upstream. The analog input subdevice supports Comedi asynchronous commands that use Comedi's 16-bit sample format. However, the calls to `comedi_buf_write_samples()` are 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: de88924f67d1 ("staging: comedi: me4000: use comedi_buf_write_samples()") Cc: # 3.19+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20210223143055.257402-8-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/me4000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/comedi/drivers/me4000.c +++ b/drivers/staging/comedi/drivers/me4000.c @@ -924,7 +924,7 @@ static irqreturn_t me4000_ai_isr(int irq struct comedi_subdevice *s = dev->read_subdev; int i; int c = 0; - unsigned int lval; + unsigned short lval; if (!dev->attached) return IRQ_NONE;