[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <569f401a-4327-4295-677f-48037f2582a0@linux.vnet.ibm.com>
Date: Fri, 25 Oct 2019 11:49:37 -0500
From: Nayna Jain <nayna@...ux.vnet.ibm.com>
To: Lakshmi Ramasubramanian <nramas@...ux.microsoft.com>,
Nayna Jain <nayna@...ux.ibm.com>, linuxppc-dev@...abs.org,
linux-efi@...r.kernel.org, linux-integrity@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Jeremy Kerr <jk@...abs.org>,
Matthew Garret <matthew.garret@...ula.com>,
Mimi Zohar <zohar@...ux.ibm.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Claudio Carvalho <cclaudio@...ux.ibm.com>,
George Wilson <gcwilson@...ux.ibm.com>,
Elaine Palmer <erpalmer@...ibm.com>,
Eric Ricther <erichte@...ux.ibm.com>,
"Oliver O'Halloran" <oohall@...il.com>,
Prakhar Srivastava <prsriva02@...il.com>
Subject: Re: [PATCH v9 1/8] powerpc: detect the secure boot mode of the system
On 10/24/19 12:26 PM, Lakshmi Ramasubramanian wrote:
> On 10/23/2019 8:47 PM, Nayna Jain wrote:
>> This patch defines a function to detect the secure boot state of a
>> PowerNV system.
>
>> +bool is_ppc_secureboot_enabled(void)
>> +{
>> + struct device_node *node;
>> + bool enabled = false;
>> +
>> + node = of_find_compatible_node(NULL, NULL, "ibm,secvar-v1");
>> + if (!of_device_is_available(node)) {
>> + pr_err("Cannot find secure variable node in device tree;
>> failing to secure state\n");
>> + goto out;
>
> Related to "goto out;" above:
>
> Would of_find_compatible_node return NULL if the given node is not found?
>
> If of_device_is_available returns false (say, because node is NULL or
> it does not find the specified node) would it be correct to call
> of_node_put?
of_node_put() handles NULL.
Thanks & Regards,
- Nayna
Powered by blists - more mailing lists