Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3355751pxf; Mon, 15 Mar 2021 07:52:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGFHcEjvl+XIdfm80dcOTfusdBUpZ6LIbGFC/7exE8967fuw4qWMYjZUcUpEKqZhPiXZXe X-Received: by 2002:a17:906:5d06:: with SMTP id g6mr24029972ejt.216.1615819816658; Mon, 15 Mar 2021 07:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615819816; cv=none; d=google.com; s=arc-20160816; b=ZQ1ljZBnarS46PWymwvjSWrqflrcwQuHqdpt3wcUDr4GCK8xh87gVz/DUaQDm/fuiH E4f80fRv/hDFP0VLXi6IywLstn3I2Ah0djs1kgpHE2hC+qbzgkJ68PXtoVFt38OcL3tY cafXQOQLRkQvaWNwOiH8/NfAEa0vLvnC1dmSHHZE16ZxTnWXmJXyb4Vs7LhL0IWuoMZs Qn4Xzs6XFVy3c/gZTJIhM78kl1cvbfhNt1GftmPHW2TMFGZSpMmqo6ALDNq8o3cUa4Tl 8YRcCb3Azs+HP5T8Fc+4ZE+nmYikGegejrB/vKygE9moumzda0OZnV49q7ImhoB4zr1+ ymGA== 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=FycINC4O6UaKStYp0qYRtC1b2tEjAQzvRoxGLdcHUQvrZjEBlC0ySwAN+a9v3MUiUF IkO2WbUCuy3sHqbjhDGIm7/xHFjsnqVn/Dcsx+YROkapVAbxd7SXMLcTIboRH4Tz8upi aZpefEPqtRR6N7VqtLHEXoQNswGs2MOYlMQ8dv1j+qdyEvWu/YdKeeUso4mTJ1rv22ki q42sYCVVEsiz5xWlPnYWCX1VUuwrJb2SNm4gKhKkKWGTY0k7gaq9AxHyqjP85xTFv1N+ Eo27saqQvPo8pbcQdC2uM9cYpqS1JFZM2B24ESZInrISd9eZwcHtpXTI2sS2KiYb9wCo WW4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hJK6dgPW; 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 b7si11344952edr.560.2021.03.15.07.49.53; Mon, 15 Mar 2021 07:50:16 -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=hJK6dgPW; 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 S240717AbhCOOr6 (ORCPT + 99 others); Mon, 15 Mar 2021 10:47:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:49270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233989AbhCOOCq (ORCPT ); Mon, 15 Mar 2021 10:02:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5B94F64EF3; Mon, 15 Mar 2021 14:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816966; bh=+U3DPYnaAU4BV6e5NzWqBd35UHJisgfIAbZ7CIwD1+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hJK6dgPWHgV/1+jPuPMyI1VzbZvPs5ia0UnuFVdnn9rKFkItf3bkcmt9wK5MeekSQ 0p/NunwMLyv7Ugnbvbtjns/gqZiuzSfIPTDiXd+8FTfwBv0lk2c9qeisVPl2udWjqd kWTAFh/ZBNDsQqCTyd01vfEGZOGCNA7/Pine6E5M= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.11 234/306] staging: comedi: me4000: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:54:57 +0100 Message-Id: <20210315135515.548855457@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 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;