Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 657C5BA4E for ; Thu, 13 Apr 2023 22:48:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 055A4C433D2; Thu, 13 Apr 2023 22:48:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681426105; bh=2r4AGUeUoeN45ZcBLry7NPduP3jS6MEazXMcZDx4tSk=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=fe/70YgQzYpVg7kdBUWkl/HnpAoPIowg9lpjh74s/hQdBVwFbV0I3rF+fN4y4DSqm dabT3RGw7iBgtB/WE4qGpc+HigeDyVLJo6HqRwMPtNRcjTezZ5FHfd5XHMQfamtdhV 9CsIbkabMl4mNgzvMOaaVzR0rcMeC1Cj56/BHX0DCNxm9mXmDx+uB1AXcYZyfT/c+W 6jpMSLXbiavb68fmMIFBcSyfllCEG7p6CL8RUccbwyn8jGHoVmIFtTBiNWlEKeFgRC qYLS2tO743qgLz0u9/KEWh46c8aNhY7LJvzf3X12P2UEUv5OcXECiUNidi4tbeuoGg 2T7YJSRlA6hcA== Message-ID: Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230413205528.4044216-1-sboyd@kernel.org> References: <20230413205528.4044216-1-sboyd@kernel.org> Subject: Re: [PATCH] clk: starfive: Avoid casting iomem pointers From: Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, patches@lists.linux.dev, Tommaso Merciai , Emil Renner Berthing , Hal Feng , Conor Dooley , Xingyu Wu To: Michael Turquette , Stephen Boyd Date: Thu, 13 Apr 2023 15:48:22 -0700 User-Agent: alot/0.10 Quoting Stephen Boyd (2023-04-13 13:55:28) > Let's use a wrapper struct for the auxiliary_device made in > jh7110_reset_controller_register() so that we can stop casting iomem > pointers. The casts trip up tools like sparse, and make for some awkward > casts that are largely unnecessary. While we're here, change the > allocation from devm and actually free the auxiliary_device memory in > the release function. This avoids any use after free problems where the > parent device driver is unbound from the device but the > auxiliuary_device is still in use accessing devm freed memory. >=20 > Cc: Tommaso Merciai > Cc: Emil Renner Berthing > Cc: Hal Feng > Cc: Conor Dooley > Cc: Xingyu Wu > Fixes: edab7204afe5 ("clk: starfive: Add StarFive JH7110 system clock dri= ver") > Signed-off-by: Stephen Boyd > --- Applied to clk-next