Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3094139rwl; Thu, 13 Apr 2023 15:53:49 -0700 (PDT) X-Google-Smtp-Source: AKy350ZQZYWccV0pyUaYDjM3BUWonVAj8FVhsqCOCVGyFYHJ+ewoeUZ2L/JEGS3B/BDzgDY46Tes X-Received: by 2002:a17:90a:e642:b0:23f:2d2c:abcc with SMTP id ep2-20020a17090ae64200b0023f2d2cabccmr3600183pjb.9.1681426429479; Thu, 13 Apr 2023 15:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681426429; cv=none; d=google.com; s=arc-20160816; b=GTpthB5m8Gocoi+cAKYACiSs7I5ifX0amK6Wij1yfvY/v0ccKBtuXiC1eZ1Za3BN4U KGx4OwZ69uqWNQju8YUDUU7Xzp+1eZT5RxnknKMUoAw4BVCvR1so+RL5IyojBhI9c7R/ JSXFbLqYtqKKf6tj1gSHAZGZCtneawCzUiThkXvw2xKeDhIPnvaDgYxZvYuWolGNE5Fq nC1o8Nun/H2DmIuoPHnO15l3zSxyxoYK/xk3DCt/JhO67L57baMWKfxkgT+kSLjVMfxR 9uPyLvRY3e35SqCO+zVRNWknyu1xcb2nXFz8J7QxMCvHvR+nOfhKbJ68YZW1sw9v/TEX 0R3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=2r4AGUeUoeN45ZcBLry7NPduP3jS6MEazXMcZDx4tSk=; b=LVYtkA7TZlTsspp01TZ77xCLSlo6ItjlODYz6vfoMMO80OyfrF92qmVClgRYva/RcE vh2XR9whYYmHMP/SnB5ScfiMEQ/NnDcXBSU4sTnFpDMnzETX1cByjMV0XuyYOhUF0JyO QwjYpldBewJ2Z3a1/WVaWgLEMNb5ckVVujhhSQdJea5gAowK7qhZGO0TFPtCuOObKD6N zRPUVXmINPhv6m4jUheYvke4rJuv5wHupDZ7/2ApOJFYSq7FPBtodk/2PpLhF0xjfAeF fFey1gPS1KPRhV4ls9QeBRSPmtEdVWW5ZiKxeDkXqw0OtN2Pb1ZKsbWBF8LUPtwSmicf 7a1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fe/70YgQ"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gw6-20020a17090b0a4600b0024662765608si5618582pjb.111.2023.04.13.15.53.33; Thu, 13 Apr 2023 15:53:49 -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=@kernel.org header.s=k20201202 header.b="fe/70YgQ"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbjDMWsx (ORCPT + 99 others); Thu, 13 Apr 2023 18:48:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230156AbjDMWsi (ORCPT ); Thu, 13 Apr 2023 18:48:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A9A5469E; Thu, 13 Apr 2023 15:48:26 -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 dfw.source.kernel.org (Postfix) with ESMTPS id BFFDE6420C; 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" 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 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