From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C76AC3E8C5 for ; Fri, 27 Nov 2020 16:59:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB13B221EB for ; Fri, 27 Nov 2020 16:59:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="CKs0nGWI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731364AbgK0Q7B (ORCPT ); Fri, 27 Nov 2020 11:59:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:57744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731196AbgK0Q7B (ORCPT ); Fri, 27 Nov 2020 11:59:01 -0500 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 488BD221F1 for ; Fri, 27 Nov 2020 16:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606496340; bh=FEQKD2uS4NeAB7/FgDgHKjkpnVvpUbOQhMuZ5wi+4BQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=CKs0nGWIwa6FAGD0jY77wCSqK5IQ50QWJ0+waj2j2q3s2AM/L9sl9Fd4EAvXP8tf0 s+YgtyhOmiRTc0rHaManJZDFI8Dfn93Ua0OSUMbkm6pnvhviBOCZHTkraBYEKUbNqp 7yKqxZYqTR46kW0ToPhTAkCmTEGZlsRNilvfD//M= Received: by mail-oi1-f181.google.com with SMTP id j15so6519402oih.4 for ; Fri, 27 Nov 2020 08:59:00 -0800 (PST) X-Gm-Message-State: AOAM532jvsNe+PzQCct9oTgx0x7Ydpbe0hwwYVdhIkdZY0IenUpTPpx5 hcFN5hoJLG6brFzzrvdQ1dYCBPHUqfBJGOn92Pc= X-Google-Smtp-Source: ABdhPJwI6MrNl0eEB06+C7ah/EJ89LjM1ABRclGHvTHGYvB5f9oVjQTx1zHr7yaQZEE2339fYU02i+MYoD4goaiWtpQ= X-Received: by 2002:aca:5ec2:: with SMTP id s185mr5842127oib.33.1606496339654; Fri, 27 Nov 2020 08:58:59 -0800 (PST) MIME-Version: 1.0 References: <20201125075303.3963-1-ardb@kernel.org> <309bd3399d042ca94e5bab35980d661c@natalenko.name> In-Reply-To: From: Ard Biesheuvel Date: Fri, 27 Nov 2020 17:58:47 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] efivarfs: revert "fix memory leak in efivarfs_create()" To: Jonathon Fernyhough Cc: Oleksandr Natalenko , linux-efi , Jeremy Kerr , Matthew Garrett , David Laight , Vamshi K Sthambamkadi Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org On Fri, 27 Nov 2020 at 17:56, Jonathon Fernyhough wrote: > > On 25/11/2020 10:28, Ard Biesheuvel wrote: > > On Wed, 25 Nov 2020 at 11:27, Oleksandr Natalenko > > wrote: > >> > >> On 25.11.2020 08:53, Ard Biesheuvel wrote: > --snip-- > >> > >> Do we need to do this as well: > >> > >> #include > >> > >> ? > >> > >> 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.