Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3528377pxf; Mon, 15 Mar 2021 11:33:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH2KARE7GZr97Y/VG+aLlroviOPtSEHJBTDi2dKCSZY1meo2QqWp8dkJ6BmL50qS/Jr66G X-Received: by 2002:a50:ef0a:: with SMTP id m10mr31485971eds.261.1615833234899; Mon, 15 Mar 2021 11:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833234; cv=none; d=google.com; s=arc-20160816; b=x9l+bYthAafQQ3SCcXJ6x4HhST+zTrE1notxXNwHhWA6qGgXexxY9ckCeVEOrVEeFQ rV2IkxQ1H7P8qxV/FrpdG8lxu2lK2q4xKQc0dOOSan+h5KPnP7FBhCClCHawZa83nELD cNiQCmRcAP7t+/QUv3vLUVUAJ/R2VJeUpQ/3OllxOwOgbMUxM2naNmu2a8njVIiKggcz Zz4cTjUtoYou7w7sXzPvK3YoEn8GK8m/gNd9XAn4I6uL+nfMtDxsPo8L7Wr0dled9ZBq BSU0rTHoKiaqE0HOyjuxGseZ4xbsRzTKnIG7u03iUzqmDXNPkbaEvquGcqxxqx6QRM5V DVlw== 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=zewVWm4QjdJ93MDy3KamGY6CKRwrUXYIyjvc0Ju2TRw=; b=uoWXt/8j9xvLdqKZwvkhsbiI813fecMFp1RBboHOjwKjpJq6tFZLOAQGWQyRBXDce1 YUZ2a+9Mtq5J/MW49O05aHlu6zmHG309LYpM6ukpbUn5XpTroeYmIBUmgOCR4eng7U+d qWFBu6uEeWpREHM3k7Wm4CXXw+8jYwK83ibsK4bWi52kqW9QzdebTMvJj20Psljaq3w0 jCPskAuGwep9ZYO4qb60BLQEnnlJyf1W09WunYSQ8TCGy4ukatLjJ+Z2kYmj1hp/cHX4 J3SrpGH2DMv3maDxl/lcXkbUeNBIF2twbdJtc58zQzE4+NrBpe2wtQ5QftSAgYOhGiAY 7RrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ryUmYoTW; 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 ay5si12279670ejb.692.2021.03.15.11.33.31; Mon, 15 Mar 2021 11:33:54 -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=ryUmYoTW; 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 S237883AbhCOOlb (ORCPT + 99 others); Mon, 15 Mar 2021 10:41:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:49288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234012AbhCOOCs (ORCPT ); Mon, 15 Mar 2021 10:02:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BBEF364E89; Mon, 15 Mar 2021 14:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816967; bh=P2QOQYIZikTPjf1XFpcVc68IDWfLnmcVV5erqVDP8Jk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ryUmYoTWppNMEki16eFiZMcYIMWPCCfVQfRklv8nxoE6ejYJioIF2LOXSPuZkx07k DbVAZ2UPWuoQcdb1m8/4FaHJXIpskgzq1ZyAcZgBmH3lHaHTX5kE6+zjlyaK3hoa/y lbyMPhQsti98JdWCYlOQH+rf9z1ZXs9MZyxFgNpc= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.11 235/306] staging: comedi: pcl711: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:54:58 +0100 Message-Id: <20210315135515.585897862@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 a084303a645896e834883f2c5170d044410dfdb3 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: 1f44c034de2e ("staging: comedi: pcl711: use comedi_buf_write_samples()") Cc: # 3.19+ Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20210223143055.257402-9-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/comedi/drivers/pcl711.c +++ b/drivers/staging/comedi/drivers/pcl711.c @@ -184,7 +184,7 @@ static irqreturn_t pcl711_interrupt(int struct comedi_device *dev = d; struct comedi_subdevice *s = dev->read_subdev; struct comedi_cmd *cmd = &s->async->cmd; - unsigned int data; + unsigned short data; if (!dev->attached) { dev_err(dev->class_dev, "spurious interrupt\n");