Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1355465rdb; Mon, 2 Oct 2023 07:13:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERbRotbis5IXufj89he+OCNbtp1j0wwgCELmL3qBF1i6QgBRIEpT1bHX3ASftNr+DPlu+F X-Received: by 2002:a05:6808:3086:b0:3ae:17af:738f with SMTP id bl6-20020a056808308600b003ae17af738fmr15959123oib.45.1696255996398; Mon, 02 Oct 2023 07:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696255996; cv=none; d=google.com; s=arc-20160816; b=it+lKYYMRa1irYiCclwKua/j5lxXGPcucYSA55E0Ub+00aQ7U4kZ+g7TCyCjAgJZsN lWNKTgMcQUZo1X2Pdn3iKCkOY0MjbwU2NcYwolsG5nLE7MzazwOzcKtRjDdpe1jrF2K+ thU0qKpfdY2ZXsbUnndRslX+lOC0NY5j/SkadjoATXBYjjKXGNxWdRHz8S29LrxpARGS EQdHSI14TjabU3qIfqmf9ocqgzO9thYe8cp0khh2l815VQRitxqr5vCe4I5+Oj5THc2B WBXxhZxru/asj5KWs4D2CyVM3mlTKzf8NK8e+4L/0bUUh+bFUlTsGNWJm4Aor0crlEtF mpcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=06SStoW+Nyx8ne+29eZ3IRIdXSgQCl9LX3jUC+/Pibo=; fh=eoLaSJPa3TJMWQo/qvWGpUACjxML0lfCsLIFT+g9iUs=; b=0HKB+tbw3xovS4Q4lhIba5z62ixy1bQP94hx4uxmMvWXDIOkIUuT/KtoFUM3ccmQic 5iLQG6Vy+V6jtr6wPC0eXIonkUvOMKx0B56VWdZdTeVxs9pIFLhVOr0QrZm1/xaVF0UB bHxvcsbaVrX5tJcDB6SpLsALYKYZLJmvxeHz2Kjl0TDrMYuY6xRb/G01S2t94LSTFe78 YQxBKLaB8bbl7bWGk7+mm4Y2Q/upI2yETsx+jWe8syAybZq+KCDCS7Oqs4SeURaJvt0I zsNlg6g60N9ONdr0TyUtmReWQT6gnhQYvIInwAyob93xmia9smW2QdkzbqtZxp/WtLe6 M42w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j0U7zCa4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id mq16-20020a17090b381000b0027408bd8420si8274943pjb.13.2023.10.02.07.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 07:13:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j0U7zCa4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0DCA080A1E1C; Mon, 2 Oct 2023 06:02:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237267AbjJBNC1 (ORCPT + 99 others); Mon, 2 Oct 2023 09:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237186AbjJBNC0 (ORCPT ); Mon, 2 Oct 2023 09:02:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4755A93; Mon, 2 Oct 2023 06:02:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F8D7C433C9; Mon, 2 Oct 2023 13:02:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696251743; bh=tYgjzEelwToAG5hZdFfT9BvK6R9nIvBGWgQkejATYgg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j0U7zCa4ZJKEgJHrs6JNk97vPL6vyZ0D9Bc6O7EqQeN/NuxT9QxNhPYZ6H99cH1Dw ZFBSGpoBq/gs7nhFgC8X+KxyCCfadab6VwUtORCTGHtQSnYOovyB7KljgDJnBhqfo4 gV4vGWKbnU1k2EjogZsugUGFUpkVpg2Kvy6O3VRCUR2OFTYJ96KNoEyz5sAOe7/LBE ZkpxH1JwLYCodtwEYJcTt/0MCfP7Q079ZethW0vcHcxC6T0e7MwTl30i7sL+t0Nygp 3vq7XMSoVWHI2+PDj3jfMpzwE5yWZlnehdghfuW0oHnbQKF9eSIZXhrDxoY11V5bKz rHG2+XMiEPrtg== Date: Mon, 2 Oct 2023 14:02:17 +0100 From: Mark Brown To: Woody Zhang Cc: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] spi: sun4i: Fix memory leak on device removal Message-ID: <06646231-d67e-453a-a1a0-d2665c1f9421@sirena.org.uk> References: <20231002062957.1741396-1-woodylab@foxmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MmQt3Jv7+ExT5bXv" Content-Disposition: inline In-Reply-To: X-Cookie: Postage will be paid by addressee. X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 06:02:35 -0700 (PDT) --MmQt3Jv7+ExT5bXv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 02, 2023 at 02:29:59PM +0800, Woody Zhang wrote: > Call spi_master_put to free the spi_master structure on device removal > and driver detachment. > static void sun4i_spi_remove(struct platform_device *pdev) > { > + struct spi_master *master = dev_get_drvdata(&pdev->dev); > + > pm_runtime_force_suspend(&pdev->dev); > + spi_master_put(master); > } This is just obviously buggy, it doesn't match the registration at all. --MmQt3Jv7+ExT5bXv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmUav1gACgkQJNaLcl1U h9COpQf/ZZ2D4twgg+aSv1ip9qVUzmoZwIO04bU7hbfXvyVqzX5DF5t0YiR9CNmt kk91dpgKCXMqyy2GrjKyA4nDVyhh/hJKRLzjfTe9UjkWOV9orLMRfjm3d7GfbS0b Gezpdi3vBYozHCnAVs1A2o7qrOIJp0KrN5/9dDUAplIFSEiS/viF81OWYdfiYw9v gLu5boQeqZUJEPcSaJyVQOkzsV1rS8vhEr1cybpgRcmdn33k/DDtA29qwZkgA7Ty gHXdCG1NXg4l6htjZAsqrzLznJ6WcRwh/VuL5zJIvpfDKeiLIMJhvkMsXWgX9/6l n/qIkaJnWhvyw01GBpHeRINw0HqKQg== =tS9I -----END PGP SIGNATURE----- --MmQt3Jv7+ExT5bXv--