Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3524419pxf; Mon, 15 Mar 2021 11:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJHDIO15M85y1o48fPuy87ONL0y2VXiQTyivrcNslDSXnnDP4nnDhXf6ZGn6+f9asfeHVh X-Received: by 2002:a17:906:74c4:: with SMTP id z4mr4659181ejl.512.1615832920223; Mon, 15 Mar 2021 11:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832920; cv=none; d=google.com; s=arc-20160816; b=vZZgaMgDp1EEVhnvxM4QL3FQDbI1LTFh26iuZUSGEsooi3xphM5ZYCC8CW6EgRaR14 ZuySgmNQnv8k7rNpe1iMiDG7EVa3YPx2yzwE1pwc4Wak6tVymxHFfpk0y/8buVVHaG/T tYoD0MzwbIClPVCtTCaVDnn1tcKHQlk1lMnzi8I3YRGdm9N4daZMnoAAo/Vblr9zjkju wi6PJP4v1swnQlvG26hASdDmCG63OSXp4Y2c6h4kG9B7pokmRu021QLdN0ymiGsuv4tI xRJyG2VJyfAIh2mG8TbZyt+IKiv8ac3NJSD1pFpdQG7EwTEIt1NMelPvifEJb8H6PxX/ 6FUQ== 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=9ZtAPpFsewyCSvUB7ez6V/1FWLvYhhJ7/bI2EbMps8M=; b=PyYa9xSvjeItirPmQGxeBdtyaypMPnc1Jb4LkpMqMNNJ2gDhbrbOeF2YPgPg8k2ipb keKvoOOWhhAW75lZolWzR8nkwOZEFTj/8/1cIs8B95admcce3t0nrLxwJRfcZrYopldY WprdCUoNhIkep/fWR5jXElqWQj5X+q5B8DOgaqBUpedLZuQKG9X/eAQL3wVofP2C16un xOB3qT5/Uv8Rdgu9yIzcGLR2LX0ttKODMK7VyhgU0DdNYUWZzQOfGdM8VLb+ArTAicYo /oNnoUbVeNuIfLNcP0lRH1+52pOH9KEJr/9dffKedwaGbEvTJPjCU3zSpxlR0dusOfJy khPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vDaa1j3u; 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 fi16si11919986ejb.239.2021.03.15.11.28.10; Mon, 15 Mar 2021 11:28:40 -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=vDaa1j3u; 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 S235522AbhCOObz (ORCPT + 99 others); Mon, 15 Mar 2021 10:31:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:35904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231743AbhCOOBK (ORCPT ); Mon, 15 Mar 2021 10:01:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F12A964DAD; Mon, 15 Mar 2021 14:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816835; bh=jXmsmJ53SzD4UnqQjC8pqBIu+n78DV1VH/uxOqQKBCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vDaa1j3uu1vg+9hmnwq9m7vdOOC9q2tL55IlLXRwmXxjZ0rGCs+cI7lUnMoIFbAuA e4reGlvOjFE3AolbI5dgYq89ce2fZ0fORzMr/Wf+dSpkUOjfPIFvxJy/cTXayhgDcK 1m8oFw4joLFlorYCeW6o49UkCCxbl6yNzjoCnpOo= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 4.19 101/120] staging: comedi: dmm32at: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:57:32 +0100 Message-Id: <20210315135723.278834062@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 54999c0d94b3c26625f896f8e3460bc029821578 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`. [Note: the bug was introduced in commit 1700529b24cc ("staging: comedi: dmm32at: use comedi_buf_write_samples()") but the patch applies better to the later (but in the same kernel release) commit 0c0eadadcbe6e ("staging: comedi: dmm32at: introduce dmm32_ai_get_sample()").] Fixes: 0c0eadadcbe6e ("staging: comedi: dmm32at: introduce dmm32_ai_get_sample()") Cc: # 3.19+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20210223143055.257402-7-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dmm32at.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -404,7 +404,7 @@ static irqreturn_t dmm32at_isr(int irq, { struct comedi_device *dev = d; unsigned char intstat; - unsigned int val; + unsigned short val; int i; if (!dev->attached) {