Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3526094pxf; Mon, 15 Mar 2021 11:30:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfLvkEtpJaSBTJ2X8OwwS6c7HkSHp4NIyw5bmHEg9R5NEhryyQk3FyPYOEcKqd5e7NDpq0 X-Received: by 2002:a05:6402:4242:: with SMTP id g2mr31277054edb.329.1615833053087; Mon, 15 Mar 2021 11:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833053; cv=none; d=google.com; s=arc-20160816; b=jzlyO7C+T0OMWxPBVmJ8vnXHd/EW+4KuBR1tVgq7c8QzeoFarQ3ZKLqRS1921nBV/F +5ZNlNbcHBOTDYvoG95dF6z75nJJjKFhZn3tykrvf4zxITLK+Qy0lCDvYaRUr2TLgsKM 5dB+KSOv5mZb8YGhKoJr1Hd6O3QbUmNQGJQMUaUmEwMSQh9MrUb/vJX8PG0vYwshJTSQ WOwW9QlJAiz4BMVHt3e5uUhSOJrpSt2wM7cd/LRQbK8WOHSi5wIYZoO1FodF/HwuZwKW gh+hVWKY/dm4arGJtgFgn+DALe0EuaikG2yMmHfwSteAQkmeB63AdzzDqECKgdZPoB7h rADw== 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=U1VD6iyIU//gC8K0/tjlIWeZ5cjKa3tNK+YNpmFGODI=; b=rdmKLl4bZ195i+/fDVeXQL6xqoq5tZvYYv7scZPdeDW6d2CbudnW5HITt7wudc74qE cgit3OXVM597Sb6iDPI0LBVnDXfVQq+aYZWRgy8t02BMBYXcZElh+S7TnEYSXHMq4Qjw indnpwlcwrJU8MOfG2VfS6kKGnhfeIqDCA+p3LZUzWfPhuSxbdeRuTWODc1YjJ56/qaT a5AabaEsGDDlNfXellbtfUpWPDw0//Wkvy2I62yJ1yzy/XiILW0i3emX0cOeixjs18wk YJwyFX5+PbU/5QHa1bveaeePJAEWDeOzPoYWe27IO25wQVm1IX8gO+VymgBiFC5FW7XB BCUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=adi6+bzK; 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 d22si10927686edu.604.2021.03.15.11.30.29; Mon, 15 Mar 2021 11:30:53 -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=adi6+bzK; 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 S240073AbhCOOd1 (ORCPT + 99 others); Mon, 15 Mar 2021 10:33:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:34900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233134AbhCOOAo (ORCPT ); Mon, 15 Mar 2021 10:00:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7BC7E64F9F; Mon, 15 Mar 2021 14:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816833; bh=pWVrf9WJrCrW6pcncVZT4ohTEHF2z1MMs/CPqbxUEps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=adi6+bzKT/fHb/CnM5uKDsgg1S3WYY27NUPQ2Ls/rWl05SHe1j33bPY55MJqgy0PA WHrX5Va+SXGYyPZQFf/KQa2QgZhtMFPJMpmdxqDF5Xjr8fyQOPV4EmzbgcsKbOUyrX NrIX11fzLffRpi2dxAgttHsAIrslgPJAs2C4yrBA= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 4.19 099/120] staging: comedi: das6402: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:57:30 +0100 Message-Id: <20210315135723.214115418@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 1c0f20b78781b9ca50dc3ecfd396d0db5b141890 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`. Fixes: d1d24cb65ee3 ("staging: comedi: das6402: read analog input samples in interrupt handler") Cc: # 3.19+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20210223143055.257402-5-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/das6402.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/comedi/drivers/das6402.c +++ b/drivers/staging/comedi/drivers/das6402.c @@ -186,7 +186,7 @@ static irqreturn_t das6402_interrupt(int if (status & DAS6402_STATUS_FFULL) { async->events |= COMEDI_CB_OVERFLOW; } else if (status & DAS6402_STATUS_FFNE) { - unsigned int val; + unsigned short val; val = das6402_ai_read_sample(dev, s); comedi_buf_write_samples(s, &val, 1);