lkml.org 
[lkml]   [2019]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v9 1/8] powerpc: detect the secure boot mode of the system
From
Date

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

\
 
 \ /
  Last update: 2019-10-25 18:50    [W:0.166 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site