Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3522811pxf; Mon, 15 Mar 2021 11:26:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiBQwjTKqnWIC8zethJ0NFzsyWq1mL1CrT7waaShMlLO/JmmEMyWZ17Ba4FGnn+ct/vgzm X-Received: by 2002:a17:906:73cd:: with SMTP id n13mr24661677ejl.535.1615832799834; Mon, 15 Mar 2021 11:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832799; cv=none; d=google.com; s=arc-20160816; b=kDL48DvvNhGY1D5OcNrxUEdJ86oWVM1am6JnAXv2qZ70Ae9vokdcOckf9ekRg7pb9q anbZKMW8fwVlzCA0GdRad0wNx6veXnwXF+eNxCLwc/jBtkHMkQ+DpB8U3a6EM9BTd4Zo KqiQtrdqIl+FOioxfjfEYQlLtPCtxbongjCUKOdIJdUedTD376dZqLqRvXwZ5oEK3+Vh s8Y9SLn7yrNL45yhmiKrETqEqpO4TTc54ti98EoQpj7gG7lou/sMdEuVrUe7E9IAGa1J +iAOmSAzvp4sHbRL51a2aoe0L2inOXIXhGN1iUyN6+8OiusPt9bWY5RrqCYDEe1LsqSJ j4Cg== 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=KaznOx740IwZxbLoKdjV9m0BA+ait3dTuAZg5d7XOf+zPDA8sQ+lyMzit5U/TquvqW L/4aMXSFJwP24qAvd30wKKWPXKgqHDVzI7Kl1rcj/S0KkQbshnLZv2WpXkgwgjU3VU2G gc17geih1WgEMTpgHyV5B87MMSDct8FQDz3Rd23DjsnDnThMFBfzRlBksuKlohq08OzU mcfpIvopIlUqxOI8/dq4O+b5uRvPYsjOBjSKXQj8DOEZReivKAMIbNrfuEm/eveebpMQ S+ajBywMgSEHhh0SJxSJ1PQYsgWlTXGc+8maWeeQvf7sWdk9NwUiu3BCfHWi1COrYqvI uFcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WhzXKgnV; 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 s20si11283422edq.484.2021.03.15.11.26.17; Mon, 15 Mar 2021 11:26: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=WhzXKgnV; 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 S230371AbhCOO2D (ORCPT + 99 others); Mon, 15 Mar 2021 10:28:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:37500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230118AbhCOOAn (ORCPT ); Mon, 15 Mar 2021 10:00:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E504764F87; Mon, 15 Mar 2021 14:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816829; bh=jXmsmJ53SzD4UnqQjC8pqBIu+n78DV1VH/uxOqQKBCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WhzXKgnVSijSssVS/K35eghPPDF+vEIy0sZJtbn0a55qJioyOyNqxFzCv+cjNff2z ACNtTqyW6hEYBt6X7PVW4oj869BCPQsBl0E/sv9qEw0aiWl2fQoJguIFXUdx+ts9dc Ze8rRptOZeOGWPk8TyX9oZvkAQWGit2ZpDp+Arbo= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.4 139/168] staging: comedi: dmm32at: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:56:11 +0100 Message-Id: <20210315135554.903529264@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 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) {