Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3524966pxf; Mon, 15 Mar 2021 11:29:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzBsmyHIbi7I/TwnCLgGtTBVTKlEPrPlJwCVkx7U7Cj7JaaoEXEDyd4TcUNznM9bsRBHqb X-Received: by 2002:a17:906:fcd2:: with SMTP id qx18mr4387399ejb.327.1615832963057; Mon, 15 Mar 2021 11:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832963; cv=none; d=google.com; s=arc-20160816; b=WtnCV62g6hTrlBUzw24rCkV8blhN3CznRqBmh1dQneNwjtsjet9mhuYUG3N/VXjcDA /YX2l+F9YNNIJ/B7PF0eUKiytJQ2X8yLuOzfhJDFdeYoLE0xZGLPSBFDjzDcl7Ee9PK6 hUn3YlJUDwvect1lSKddVxHwzgJs7wFMOOANT17cxMebJtP5l/oamVdhHAWaac7urGSO GuVG6z7v3oFH5nGdpj7XUUGj3gym1h9E0J09kfBM9IAD3lzVFrMvvk5xy5DqFdGghG6o aI/wj2YoIHEmoCU6TMi0cLp9/BCMmfKxm2abvflwn35/OuOHUneomnneWr3xV2ZZcV72 +kBQ== 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=LX/M7mSHFgn4zhfVi+/tbBCW/xjVEh/lW4fJjyuevXlp049JZjV2fK/HWLG1tETxJw pcXvUEmIP+z/1uZlx1zBDksuve/G3dMNfJOaFeudcXS5PqT44gFTIoAmHdXomBdDMFsG h/V/TqDMDUK2uWFfObNhXAMmWC8DfgjrOxA6sV3+bxCSUBc+cWQhziV4wEqSATSxJsfG hrjBm9Z2PZ/5YeBjxxITHItddkCiT5m60YPZJpTrm18MyJ4/aJgUBypZEDsiICVGfhi6 Fm8jaZdWjxNPn5gW4Edgca6CVn2mEVoivTxCZUtmxzQKQbX2OTwM7GRdOowxCi9Y0KhL hu0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M5TR2aZ3; 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 gv29si2212771ejc.61.2021.03.15.11.28.53; Mon, 15 Mar 2021 11:29:23 -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=M5TR2aZ3; 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 S231241AbhCOObo (ORCPT + 99 others); Mon, 15 Mar 2021 10:31:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:38284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233207AbhCOOBK (ORCPT ); Mon, 15 Mar 2021 10:01:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 375C964F17; Mon, 15 Mar 2021 14:00:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816837; bh=+U3DPYnaAU4BV6e5NzWqBd35UHJisgfIAbZ7CIwD1+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M5TR2aZ3gKbijTRKR5PXEai2e/hmrHFSSRFIV94T5AhvDzAGYrqLToUe0/R79CH8V V0TvJ2ZedqSqMUgOhXJL/Ys51B5mK3hdb3LSTpE4nUjsnJjfg20i5aVZbg+0iJoFjH dGzkvsI4vZZXLI6c9xsNLF3O3W8Q7wi3rbGO9+nM= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 4.19 102/120] staging: comedi: me4000: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:57:33 +0100 Message-Id: <20210315135723.313967845@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135720.002213995@linuxfoundation.org> References: <20210315135720.002213995@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;