Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3354358pxf; Mon, 15 Mar 2021 07:50:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUMriBUW/6+ujgltQXXKgcKpFt6alMfWMTRJxdE+cRgcNwDUZOR+PB3xVsEVH62ZfhqHJI X-Received: by 2002:a17:906:7cc:: with SMTP id m12mr23424303ejc.171.1615819816628; 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=xcMi9c+/80TbafY8niWqPPX5Rjgcgsaj/FkWWKdQEs274AhaN0ZEBvkzb6oS0ysYJz zvJBSC1sHUkHVmJeFDPgm3aYhLMXkhbljL4rU+NSq87EJJ1WZUqnsqbN1ozsK2zEiDpm MVBxizUtD/+KsszIVu2XFSJPMp9kNfoyjXb2xkKt/Ch71REzfVxXZ8FcBmCKCqXt4ZZH +YGr94ELPBy6efpRPBtj3q6GTDbEAFWaQhLkAZ3+bvjzStsrvfPQuRrDUrN4ge1GiAWh eaceJ6cGaTlGZn6pWA+Xz2+smG6+p895LUPzLrmq69uIemEBuQI2YG3s6f64f3S4Hjhv 0EUA== 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=ulVkOmpkPuVDBv9Cl8fpzA7p/2CEl0hXKWqSOdYaXprDHsnJ4nkKR5aQ93hTEU6VHz NzVYSn19iE8HlPnLovIOQjUa7DzxL6ARcEt/sUOe8b/aVqfUE4rgbFeOYkOlW0egO4Xt dLKLIG1WIPViC6zVqpmLwo6wpj/7mHLphxyEKgcN1VDrDoqPNOrnV4y+EiIAi0k+nhb0 uO9gk019NmOhu/QcEWY88oFTQHve81Mt+26NN0Lyv1FhAjdEbJYYl4m7HckASuMUAPsF noyGo4xVXAmk8T6TGwA4PhDSBRn/dC2gUkLR/0mfXlRR5ikcsyJspyPk363EU9calBLC SM+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uvS3vuSq; 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 w22si10627818edd.295.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=uvS3vuSq; 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 S240778AbhCOOsD (ORCPT + 99 others); Mon, 15 Mar 2021 10:48:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:49272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233986AbhCOOCq (ORCPT ); Mon, 15 Mar 2021 10:02:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 16D6664EF8; Mon, 15 Mar 2021 14:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816965; bh=jXmsmJ53SzD4UnqQjC8pqBIu+n78DV1VH/uxOqQKBCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uvS3vuSqNpnnEk5NxxilI2yagYyhDP+aB9eXHjjvw2MF2OFjLBi7IbNWTmNA58EKt TFVSjVVhq+L0Vq3BkZCURDgv6VKVZcUwiHZRvLCKv2s8jMyB6GEHBuccl30oy6tSpP Q3C1Q9OmAT9LhsUAmbjshfYzwYCf25MfjnYGODYU= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.11 233/306] staging: comedi: dmm32at: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:54:56 +0100 Message-Id: <20210315135515.507894921@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 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) {