Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp935433rwi; Wed, 19 Oct 2022 04:59:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4K+T3JOR8G+pYqPS0JAsD2f1EMAOlzFhN0uHgyJ59zqlQGATDHaNeF4D4qwFGtpQruWc+M X-Received: by 2002:aa7:cad5:0:b0:454:88dc:2c22 with SMTP id l21-20020aa7cad5000000b0045488dc2c22mr7131951edt.352.1666180751759; Wed, 19 Oct 2022 04:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666180751; cv=none; d=google.com; s=arc-20160816; b=0jTlRV4aLWd+J1hvkC37XiCyjTdTGWB+SDqlRNZUrzXh51PofcnHmkd91YZkJSBpHY hAEhPHINBdL6l5MP2WcH76ZFVrlsFcpuO07lb3lQzN3+lsO8JxB61BgtrXMYGRWNiwrq EhxI8LwbJlCMrMCzpJl0uWLfOERjRB/8gokKUXYMXA7B8Z9uEL0+qTb8BzqObZphVa1N /etvBI973k1C/OQKb4rCZ4x6PNy/Q1zUGTxqiafhUPsRHUtwDW07gw25/Ek/BMzWodgQ J/fTVWpGDVP3a8or4SCB56QKC1HFeNknNloHlkqBh8peuBPTxKia+mGgZzPdCdJKC8Si rTCg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a26-20020a17090682da00b0078d9d67841fsi11739391ejy.400.2022.10.19.04.58.44; Wed, 19 Oct 2022 04:59:11 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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);