From patchwork Wed Oct 19 08:22:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5214 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp265059wrs; Wed, 19 Oct 2022 04:21:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7WbKapoRVosy4najYwrtuuiiXhOQCPxDzKOp7niHBRqgeQWAeAsRZMl/is//7Oi6YMW6jH X-Received: by 2002:a17:907:9493:b0:796:1166:70c4 with SMTP id dm19-20020a170907949300b00796116670c4mr196460ejc.59.1666178493214; Wed, 19 Oct 2022 04:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666178493; cv=none; d=google.com; s=arc-20160816; b=wBja3xUUTgrvEJxdwiGjzqPw/jQojEdWADsovfEl4sEZD/lAcIImH7dNw9CtT2ljiN gSswGFJDvHydd0Dc+uliMp2R2HPDe6izDt8KXuuiYg8MXhUzgiG4crDnkDhBGitziuFy N3LCUoQ1vBTlvsX9j9OYEDVoW9cPFKy36vqB3mQfvgd/nJ5iAIZB0MTgYzpye5c24d7q 16GOJU83neaift45NO6wSoHHSNObC58IWvkQvaSpk4nLjWAleq6U0lIpXV9CJHtqKPxr Jj0dDhDp6ASPnXVLxteh5+iDOdIiJ9jcJDGgTujdI1CE//r6dgBDOKvtZUuPtOuuEE58 SK7g== 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=LJ8bvoD3HZ9kGLyEXHZKDnMOHyNJQxzPTbjPj2ynIhM=; b=AGjrDVhBtOtNulu2WdAp1w887H+bhBOUumoUwonprj4f2rcr3wksLVywa/j2IiG946 pL8ffPId9Xi4M4x7pg2ARrVRBWfMjanTPjVNBRa+J8IiCNdViTkHSI5U1g/oa3qU5WM1 53JkXjk9NmAlOaO7Rf6+6vAAvjvxUI+NjK285ELCYJbOXGbYDJlLgyTdB6h4hb7fNg0/ 3FbshhboRy8khc9T+XfjiJ8SbjSjdD4Kxh6uDp1Uo/Nc/wWF3FK9c3x7rZ7Al5AGke9g Os15chBOVlwYTXJ0UdqONrtUl3cb/VFz/wsoPWwQ28DMzXMvDwMI0taMOo5eNZkXokpI 9bpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PwnBkhXT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb6-20020a170907960600b0078b96722000si16248906ejc.608.2022.10.19.04.21.04; Wed, 19 Oct 2022 04:21:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PwnBkhXT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232885AbiJSLLR (ORCPT + 99 others); Wed, 19 Oct 2022 07:11:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232922AbiJSLKI (ORCPT ); Wed, 19 Oct 2022 07:10:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2D9210A7F5; Wed, 19 Oct 2022 03:38:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2BB71B822E3; Wed, 19 Oct 2022 08:42:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D6AEC433D7; Wed, 19 Oct 2022 08:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168955; bh=DuBg9+YDwGfVhiIKCEuJSBEIpdJSRSK0lHMA2+ye9Qk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PwnBkhXTuDQtJW3DpFhHttJU1ykUo7soO7SMyYCAUp/v6rQsHJFFJBkZuiIdQV96m 7bWYVTSgVY2L9LGN8CUWPv5+yg2EI9/A2jlWo9zZRb9ek+xWZ3u2Fw+gzSd4Z/K8FH UaLeAuVNTPPk6oDkII08rMM6lxDwiiTZ24AqJ2T8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Marangi , Arnd Bergmann , Dmitry Baryshkov , Vinod Koul Subject: [PATCH 6.0 072/862] dmaengine: qcom-adm: fix wrong sizeof config in slave_config Date: Wed, 19 Oct 2022 10:22:39 +0200 Message-Id: <20221019083253.109400728@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747114779532409526?= X-GMAIL-MSGID: =?utf-8?q?1747114779532409526?= From: Christian Marangi commit 7c8765308371be30f50c1b5b97618b731514b207 upstream. Fix broken slave_config function that uncorrectly compare the peripheral_size with the size of the config pointer instead of the size of the config struct. This cause the crci value to be ignored and cause a kernel panic on any slave that use adm driver. To fix this, compare to the size of the struct and NOT the size of the pointer. Fixes: 03de6b273805 ("dmaengine: qcom-adm: stop abusing slave_id config") Signed-off-by: Christian Marangi Cc: stable@vger.kernel.org # v5.17+ Reviewed-by: Arnd Bergmann Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220915204844.3838-1-ansuelsmth@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/qcom/qcom_adm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/dma/qcom/qcom_adm.c +++ b/drivers/dma/qcom/qcom_adm.c @@ -494,7 +494,7 @@ static int adm_slave_config(struct dma_c spin_lock_irqsave(&achan->vc.lock, flag); memcpy(&achan->slave, cfg, sizeof(struct dma_slave_config)); - if (cfg->peripheral_size == sizeof(config)) + if (cfg->peripheral_size == sizeof(*config)) achan->crci = config->crci; spin_unlock_irqrestore(&achan->vc.lock, flag);