Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1449943rdb; Mon, 2 Oct 2023 09:47:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbiMiT+DhJwUoycBPqhGEBIil1/CjdukXFSyH6tVR73+sEMx+2q4KtOd8BEivUGOqJn7IY X-Received: by 2002:a17:90a:4498:b0:277:7810:ac74 with SMTP id t24-20020a17090a449800b002777810ac74mr176364pjg.10.1696265257391; Mon, 02 Oct 2023 09:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696265257; cv=none; d=google.com; s=arc-20160816; b=kf7PWWXF4mPI7sOm0pKl5Mca1G7cwnNrY7znZ4+uCDmIOeDJFsHb1r2HcYLD1zCWQN Uh8FPT4KqbAk5AJWXR5Rj1/h2DkB/uRWQ960/YDNNcwoV/cQgGonSW4anCs0KAkD/nw4 xdxFa/Vq7OdA3Zmq6IJqv9eT6yWXZoqeemhqVKsF0dRgOj4f6RPS4RKzcAtMRHmaUtzI H/tmb0PCzf4TPtFxe3J6pENKJOVVsM655lV566k54Yw6uf0hjT6eOH8wwEGhWBV2RJ+H cqStzK9tjQoPq4npXnUAzHYj9PkcPT3cRvg0tOOwXqbTLyVE8mzu47WmBLZnirIqYukO djkA== 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 :references:in-reply-to:date:subject:cc:to:from:message-id :dkim-signature; bh=kX93wG8sDvK/NYNskFqLEmdWnX99G5sekJ2NkAtEEsY=; fh=aXZP9pmpVi9BEN0hkl7DS0oRwdUevA3oDSW2PJtfFWA=; b=vfMZbfq2Gg9TcQeezwsO8BtjDFXJrhFrGTPAiRICx91MKFCFDkwdGcti6ory8m9M2p irN1Avm5z9AHDxO5ZPBw8V8h0esQBZqxl9hFXt++prHeLuWEuCX9epj1zBj03NYNbxL7 DWySE9z7olS4F9p2xnfRTkwryhQSPMjK+RlxsLO10zvg+DWbcdurzKMtLoOJegtZLB4n kUokovAhoLdT1i0mMDvynLzVYzrs9TuFrVQeiehcYaHOQStB0W0hFhQeSuyZQowJ2evD 0VxNScgtvbIwZbhD6DCwSsHFRxo8p6FMkFfGlyZ9chnxRJh7ju23t2U8b/jLbaUsvnOe LE6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=vCLTs4r1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c20-20020a17090ab29400b0026f4d1e6940si7609943pjr.160.2023.10.02.09.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 09:47:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=vCLTs4r1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 02050803F135; Sun, 1 Oct 2023 23:31:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235526AbjJBGbV (ORCPT + 99 others); Mon, 2 Oct 2023 02:31:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235524AbjJBGbT (ORCPT ); Mon, 2 Oct 2023 02:31:19 -0400 Received: from out203-205-221-155.mail.qq.com (out203-205-221-155.mail.qq.com [203.205.221.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A8F5DA; Sun, 1 Oct 2023 23:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1696228273; bh=kX93wG8sDvK/NYNskFqLEmdWnX99G5sekJ2NkAtEEsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vCLTs4r1NfyHuQVDcDd8PKnW2nJccRaJX3oJbjLqvYw+K9RWHaO26Ug3ps53/yfAT pNuZOeUp0ErF4yx7bZPWMi5/1N1TLPF+ZJ7YKdNIZFgMA1B7NrgmR6OyfP4oBcOJ+X XT0U86VTIySy67q8xGEuQTHP6l1tInialJPrzuKc= Received: from localhost ([124.78.196.55]) by newxmesmtplogicsvrszc5-0.qq.com (NewEsmtp) with SMTP id 7CBA4A46; Mon, 02 Oct 2023 14:31:11 +0800 X-QQ-mid: xmsmtpt1696228271topi6npl5 Message-ID: X-QQ-XMAILINFO: OY0S8v5Ciex7OzVci6wQgTcll1R17sLVOkSa/oS4MllxcNQnLA9qrynZPm41Ce 4U5e1tX7oL803Eg3UrVo65g/alL12hAVQYsfhfjnBKjw5sgI5/fZwiiJ+/L7ETlMzl4zhfHvLWlf /tYsmjBO0o1S4OuPAF/Yadm87s6ljOUsSKYixfvnUJ8mj6Q2XwiVstnaz9sAYogpDcHPtlwmtpWJ zZOTGx6Cc67qKe0Uy4/tfyvcf2QJW5P/jDqCtAzw+1/bCa6JS8GHmsA+hRYd7HTJoHdB+ta+I3Nv Ds7VTGg8YAMZu4eKsvw4lGX/HFM8sV5El54QhICD2v1bT7JL/Ieq/y1LH/Iwn5EnkOmKASfy4yEH At7N6lE+UgsuTMUa1k6YHgN95xnf/3makLJcvXJzW9N08Pjqeb+kjpCSHuGPFPqHPBRNQbl6yJJu hqr1mlWI6N23vE6FCRpqwqKfi2ZBUQ2vHoFjOK8H55K15jjTjPSsenqKoNa3+Wf/GsfdPDKWzO7A iWf7WTvubXAHojuEkYfrKqrxLzho+v1sHtSX+hluU5ODRmK7oNY/s74bqL4TBjgvvEZ3R6vKXnNa 7P+bNe7tjMfsWcfJjkp8hsA5V4f98YHGlyZoV3gUbaZ2zOnFIHFuWPXD1pG/ILIVBb2s3hqJmn+p vK6RYqWs/JajWSCK/1cSsyM9zqDcWiLAHwgyMtsEUuuWzSLXlahlpw3x0lysbTIaPsBKEYFYfEpC 34kFGzTtXPmGnPOF24NrAN7FSq8f3AQhNcWAC91PkdO1Em+lzj4Hx5gUo8q1G21Frfs0m1P5bOnj XliLkjRxzJyN+Bo95dVPgcTZUSMovoZsrU+qkeWuzcPG74b/CA//G8ppwQKDt3ZKB3YcqyIXN6Wg wG2ewY8rKV8ATEb8LJt20KiiR1ZsSCIga0c8RUf7JLG5puwLgc9aJMsMW2dWT8VxrAcUrTMZboX2 qt3TwiQ2boZXyF9vR652Mmjykvqx7SKLtbIf1eCHsUSmK+0Ou/NMkhHv8W80P6yqiwgH4Qm6loJ0 e8pxYPbA== X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= From: Woody Zhang To: Mark Brown , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Woody Zhang Subject: [PATCH 1/2] spi: sun6i: Fix memory leak on device removal Date: Mon, 2 Oct 2023 14:29:58 +0800 X-OQ-MSGID: <20231002062957.1741396-2-woodylab@foxmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231002062957.1741396-1-woodylab@foxmail.com> References: <20231002062957.1741396-1-woodylab@foxmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 01 Oct 2023 23:31:40 -0700 (PDT) Call spi_master_put to free the spi_master structure on device removal and driver detachment. Signed-off-by: Woody Zhang --- drivers/spi/spi-sun6i.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c index fddc63309773..33cec49d5538 100644 --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -774,6 +774,7 @@ static void sun6i_spi_remove(struct platform_device *pdev) dma_release_channel(master->dma_tx); if (master->dma_rx) dma_release_channel(master->dma_rx); + spi_master_put(master); } static const struct sun6i_spi_cfg sun6i_a31_spi_cfg = { -- 2.39.2