lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXb+w6dSnFHvx6zTrXq1bKogrRjsodp+s_9jJcs=X5yFg@mail.gmail.com>
Date:   Wed, 24 May 2023 08:40:07 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Mark Brown <broonie@...nel.org>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Osama Muhammad <osmtendev@...il.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regulator: core: Streamline debugfs operations

Hi Mark,

On Tue, May 23, 2023 at 5:16 PM Mark Brown <broonie@...nel.org> wrote:
> On Tue, May 23, 2023 at 05:03:58PM +0200, Geert Uytterhoeven wrote:
>
> > -     if (!regulator->debugfs) {
> > +     if (IS_ERR(regulator->debugfs))
> >               rdev_dbg(rdev, "Failed to create debugfs directory\n");
> > -     } else {
> > -             debugfs_create_u32("uA_load", 0444, regulator->debugfs,
> > -                                &regulator->uA_load);
> > -     }
> > +
> > +     debugfs_create_u32("uA_load", 0444, regulator->debugfs,
> > +                        &regulator->uA_load);
>
> No, it's actually useful to not just dump these files in the root
> directory if we fail to create the per regulator directory.

If regulator->debugfs is an error, no files are dumped in the root
directory.

By design, all debugfs functions are no-ops when passed an error,
cfr. the comment quoted above:

    Other debugfs functions handle the fact that the "dentry"
    passed to them could be an error and they don't crash in that case.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ