Linux-EFI Archive on lore.kernel.org
 help / color / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Jonathon Fernyhough <jonathon@m2x.dev>
Cc: Oleksandr Natalenko <oleksandr@natalenko.name>,
	linux-efi <linux-efi@vger.kernel.org>,
	Jeremy Kerr <jk@ozlabs.org>, Matthew Garrett <mjg59@google.com>,
	David Laight <David.Laight@aculab.com>,
	Vamshi K Sthambamkadi <vamshi.k.sthambamkadi@gmail.com>
Subject: Re: [PATCH] efivarfs: revert "fix memory leak in efivarfs_create()"
Date: Fri, 27 Nov 2020 17:58:47 +0100
Message-ID: <CAMj1kXGVE5Na8Ms4=Qi0aq=CY1MCcupAF4gsz95nnZJB8nh8JQ@mail.gmail.com> (raw)
In-Reply-To: <a07e1520-f08b-2456-a954-707e0c3bcb4a@m2x.dev>

On Fri, 27 Nov 2020 at 17:56, Jonathon Fernyhough <jonathon@m2x.dev> wrote:
>
> On 25/11/2020 10:28, Ard Biesheuvel wrote:
> > On Wed, 25 Nov 2020 at 11:27, Oleksandr Natalenko
> > <oleksandr@natalenko.name> wrote:
> >>
> >> On 25.11.2020 08:53, Ard Biesheuvel wrote:
> --snip--
> >>
> >> Do we need to do this as well:
> >>
> >> #include <linux/kmemleak.h>
> >>
> >> ?
> >>
> >> Because otherwise for 5.9 I get:
> >>
> >> [  148s] fs/efivarfs/inode.c: In function 'efivarfs_create':
> >> [  148s] fs/efivarfs/inode.c:106:2: error: implicit declaration of
> >> function 'kmemleak_ignore' [-Werror=implicit-function-declaration]
> >> [  148s]   106 |  kmemleak_ignore(var);
> >> [  148s]       |  ^~~~~~~~~~~~~~~
> >>
> >
> > Ah yes, thanks for the report. I will add the include to the patch.
> >
> >
>
> Is this necessary if CONFIG_DEBUG_KMEMLEAK is not enabled in the kernel
> config? e.g. should there be an #ifdef CONFIG_DEBUG_KMEMLEAK somewhere
> in there?
>

We typically define these helpers unconditionally, and sort out the
differences in the header file. In this case, we have

static inline void kmemleak_ignore(const void *ptr)
{
}

in include/linux/kmemleak.h if CONFIG_DEBUG_KMEMLEAK is not set.

This makes the calling code much cleaner.

  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  7:53 Ard Biesheuvel
2020-11-25  8:05 ` Oleksandr Natalenko
2020-11-25  8:05   ` Ard Biesheuvel
2020-11-25  8:25     ` Greg Kroah-Hartman
2020-11-25 10:27 ` Oleksandr Natalenko
2020-11-25 10:28   ` Ard Biesheuvel
2020-11-27 16:50     ` Jonathon Fernyhough
2020-11-27 16:58       ` Ard Biesheuvel [this message]
2020-11-27 16:59       ` Oleksandr Natalenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMj1kXGVE5Na8Ms4=Qi0aq=CY1MCcupAF4gsz95nnZJB8nh8JQ@mail.gmail.com' \
    --to=ardb@kernel.org \
    --cc=David.Laight@aculab.com \
    --cc=jk@ozlabs.org \
    --cc=jonathon@m2x.dev \
    --cc=linux-efi@vger.kernel.org \
    --cc=mjg59@google.com \
    --cc=oleksandr@natalenko.name \
    --cc=vamshi.k.sthambamkadi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-EFI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-efi/0 linux-efi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-efi linux-efi/ https://lore.kernel.org/linux-efi \
		linux-efi@vger.kernel.org
	public-inbox-index linux-efi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-efi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git