Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3525888pxf; Mon, 15 Mar 2021 11:30:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIrtPX63eBV3qnM4Xx+hzuqPIad/LsFULAVyy60CoakRQzjMKvQqifasrGZGXzW9YkgZqo X-Received: by 2002:aa7:dbd3:: with SMTP id v19mr31199913edt.314.1615833039103; Mon, 15 Mar 2021 11:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833039; cv=none; d=google.com; s=arc-20160816; b=Y45gAxV2uAEukDkyhQvbMl6jw3eT3P4iu6P676+3P2oKMnwUedJ5wriym5c8oHueLa EOJ23AFieLnY0d3ljQznm/tt4iCgrMkFnhJxjuJsH+eWZwtBksmfFPLAzgsZCQZssNWO wntpVgid3/hGD7EfFjb94Kcwp7g6Jad6Fk5hVXRZ7WiVO8vsSakuDFA+FJs3m42ESQGC ZOVUjRhMo6rm0uMaJzSCFzv5hbSxYRl2NT45lCnZIam1nKG8AH3VKMdf3U1BzberNQkj QrNQHs/Eda9bPChQZUNHwLRCk1wjYJ+bdhAGsLau+BFnKHufyL6ikn7QN41T9aEarKUx KFww== 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=lCTWgwYsXevxdDCRdOsVn4An8Je8Z8jfqdiYZ9Ipnq8RSjdnXyeRfCvHh6GNC24wrY Tu0MGBYfl0ZuWHNREm8UAslS1zOt8eVc7RlsRqtsojPGfWmNIcJKvGOreRjY73Gzq+7v WJ3I5tynWl45SMGKg+PJOBkOLUpo4ghW5PtHVF8rgop5lDgzHdsUYxAOp+VvaeOdqfm7 oO/Qd41eKPC1/v/BgCLqM8VCIqUa03VftGzAjZMwOBSMIrOCcLmG1u8UuYnCBmbZMoqm qgdrDAPIsgwpL1WcqA+CGoIbslKxthM5WBEHY1pRFOZDQJDR/L85qsrybOcH0ck8Wp8l XCmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vQ+N5EsG; 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 p15si10371264ejr.236.2021.03.15.11.30.17; Mon, 15 Mar 2021 11:30: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=vQ+N5EsG; 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 S239578AbhCOOcp (ORCPT + 99 others); Mon, 15 Mar 2021 10:32:45 -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 S233157AbhCOOAz (ORCPT ); Mon, 15 Mar 2021 10:00:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5C0FC64F18; Mon, 15 Mar 2021 14:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816832; bh=P2QOQYIZikTPjf1XFpcVc68IDWfLnmcVV5erqVDP8Jk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vQ+N5EsGybrS7wqyL8swN/GiRuBCbzPXi7nJcYCex097a+0ZxuHKDpyJQs5MDabIU cUFd6mBHCeUolCpTzVGZE0kH8wg/nGZJr5+nchY/PBUBD50ssTsdG2Ozt8P5UTAUiF GL1SN65r9vidqaf03FXrp3h0f50a9ek6A8oCaPXc= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.4 141/168] staging: comedi: pcl711: Fix endian problem for AI command data Date: Mon, 15 Mar 2021 14:56:13 +0100 Message-Id: <20210315135554.974399373@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 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");