Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4083727pxk; Tue, 8 Sep 2020 10:13:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqgBEIN9A44usJfehEMEdL1P4ekcuWw9rO7oupoCVxtSOoWT5+KntO9XuPmXb8V+hjsZWa X-Received: by 2002:aa7:d043:: with SMTP id n3mr26966969edo.243.1599585216022; Tue, 08 Sep 2020 10:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599585216; cv=none; d=google.com; s=arc-20160816; b=byGNpKUYjUBeAwdZggG8HdTAxyBkPlxTJm+hXhG7asL61pLk2pbytQDOdsV10Q/RNz wq2YC2hLw7ZcstJBwNwxfMvXwD3M30/9u4WBwCiP1KDj2TdwmSLuHkx+I7DZ4fCxMIOp 3iN3b7vdSNMKX5mk0I6RtUf5IbcsBWk124RxO5j0+PLVPr/7oRtS0gsPfgloULdYivxj ifcVXUysbITPcz/uANWtNoXJgtAQKuqnoGYtVcMTuwp6Xmz7VJnavG2ZRvVu/EF4+Gmt Hb6frN8Uqb3UkUuYa1HICc7SnXq5HawUu0XoINjPMRYwIuW22fKZd44BtuGn5Dwzpwqd dbjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DBN1JfUH0Pmzv28asMk2FZJnB/Jb4VKCb63xOToZw8Y=; b=JdRPqycGwNtD+aypeLPwpD7vr4BCJGsNE6qSb3SrUNiycQgpFwhMIY7I8un61hdJ22 LD4OQljJJjVOpT0iK8of6lvcpixa3Eo7mdpPpzh+83jKRxykzLVRMlrmnfLeS8qalxfb V8joc9l5aR7bP3r6iBZ0z82nWjtmuqYr/a1TTEWRzplbVNCBkGW9HiJExPBL7JejNBGB YdiZaShgNkbVABU4jB/C8dUKSs7KEPNgLfjTDURnEGMCln/yqbWWL7LQDkXWR9S4phwZ ZPOPFb80Suj8pvEZgamHBt7glfWp7Laf1Fl9+2w2QkeoWwWondoTWDC6Hf4xTnCpn6KB cFBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U0ApBhOy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si9837372eji.118.2020.09.08.10.13.12; Tue, 08 Sep 2020 10:13:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U0ApBhOy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731781AbgIHRMd (ORCPT + 99 others); Tue, 8 Sep 2020 13:12:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:59222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731806AbgIHQTT (ORCPT ); Tue, 8 Sep 2020 12:19:19 -0400 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1418123C90; Tue, 8 Sep 2020 15:36:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599579403; bh=6+P+TO1BauV6jNZ7yLmJJOENSCp0lJZ2QmNtEP9yGMA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U0ApBhOyQMqWHDRTWicWpbVIrQvBKfG1tEiHgPpeYFYQF6XjTyIiWAfksLJUMoScX JVeZZ9Ntk/rZQd9hC0U4BucEPIe9YzmvFHZvNCFWPzgOQtHsoJbs8X+IAQ5sV0Nsu/ 4uyOCR0M4ssTJQGpZMzc4Cy+V35DUETJnAJ5dBDI= Date: Tue, 8 Sep 2020 16:35:59 +0100 From: Mark Brown To: Dafna Hirschfeld Cc: linux-kernel@vger.kernel.org, rafael@kernel.org, gregkh@linuxfoundation.org, enric.balletbo@collabora.com, kernel@collabora.com, dafna3@gmail.com Subject: Re: [PATCH] regmap: debugfs: potentially duplicate the name string of the config Message-ID: <20200908153559.GF5551@sirena.org.uk> References: <20200908152859.26279-1-dafna.hirschfeld@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tmoQ0UElFV5VgXgH" Content-Disposition: inline In-Reply-To: <20200908152859.26279-1-dafna.hirschfeld@collabora.com> X-Cookie: Vini, vidi, Linux! User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --tmoQ0UElFV5VgXgH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 08, 2020 at 05:28:59PM +0200, Dafna Hirschfeld wrote: > In function regmap_debugfs_init the name of the regmap_config is assigned > in a node of regmap_debugfs_early_list to be used later after regmap > is initialized. It is unknown how and when the name is allocated and freed. > Therefore the name should be copied to the node using 'kstrdup_const'. It does not follow that the name should be copied, it equally follows (and is expected by the API given that the common case is that the name is a static string assigned at build time) that the caller should not free the string while the regmap is active. > This fixes an error > "debugfs: Directory 'dummy-' with parent 'regmap' already present!" > where the name was freed in function of_syscon_register before > it was accessed. Fix the caller. It is *very* much unclear to me why a syscon would be assigning a name for a regmap it creates in the first place. --tmoQ0UElFV5VgXgH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl9XpN4ACgkQJNaLcl1U h9BEFwf9Fqw6ngG0E+iNBhzxtUcVba2A3PvcBrAUSxh/WzkJXrgNJx4n5l8vEvJs LHkGeeDOIYawjcoaQXJiKTFHDr6y0V1xi2aQdSD2SvRWWgRdJdMFVCDvU4A3yvBC 5n/tG6V2Ko9R1ZjLUIrd9I/O75mDeY/ZgbycZHIpAwpqZaghhk6OxYr3Yzk5EP/H phjTMJoP1cd//+GlAoekgo2dUYLdni22HrZt0PfyhW2cemwWD23ULQsXma97RbgS Ab8lRAN4Ql9g+eBYsRCS1vvftd4ggy6vn/zls7iWXMEUOqcZ6u60dDASYPggedtT IRywQfMdoW0Axf0RYv9ayZHGIzp72w== =40MK -----END PGP SIGNATURE----- --tmoQ0UElFV5VgXgH--