linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kconfig: check for a NULL pointer before access
@ 2025-05-23  0:07 Bill Wendling
  2025-05-23  0:16 ` Randy Dunlap
  2025-05-23 22:55 ` [PATCH v2] " Bill Wendling
  0 siblings, 2 replies; 11+ messages in thread
From: Bill Wendling @ 2025-05-23  0:07 UTC (permalink / raw)
  To: Masahiro Yamada, Linux Kbuild mailing list, LKML

The call to 'prop_get_symbol' may return NULL in some cases. The if-then
statement accesses the returned value without checking if it's
non-NULL. After inlining, the compiler may treat the conditional as
'undefined behavior', which the compiler may take the opportunity to do
whatever it wants with the UB path. This patch simply adds a check to
ensure that 'def_sym' is non-NULL to avoid this behavior.

Signed-off-by: Bill Wendling <morbo@google.com>
---
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 scripts/kconfig/symbol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index d57f8cbba291..9c5068225328 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct menu *choice)
  if (prop->visible.tri == no)
  continue;
  def_sym = prop_get_symbol(prop);
- if (def_sym->visible != no)
+ if (def_sym && def_sym->visible != no)
  return def_sym;
  }

-- 
2.49.0.1164.gab81da1b16-goog

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] kconfig: check for a NULL pointer before access
  2025-05-23  0:07 [PATCH] kconfig: check for a NULL pointer before access Bill Wendling
@ 2025-05-23  0:16 ` Randy Dunlap
  2025-05-23 22:56   ` Bill Wendling
  2025-05-23 22:55 ` [PATCH v2] " Bill Wendling
  1 sibling, 1 reply; 11+ messages in thread
From: Randy Dunlap @ 2025-05-23  0:16 UTC (permalink / raw)
  To: Bill Wendling, Masahiro Yamada, Linux Kbuild mailing list, LKML

Hi,

On 5/22/25 5:07 PM, Bill Wendling wrote:
> The call to 'prop_get_symbol' may return NULL in some cases. The if-then
> statement accesses the returned value without checking if it's
> non-NULL. After inlining, the compiler may treat the conditional as
> 'undefined behavior', which the compiler may take the opportunity to do
> whatever it wants with the UB path. This patch simply adds a check to
> ensure that 'def_sym' is non-NULL to avoid this behavior.
> 
> Signed-off-by: Bill Wendling <morbo@google.com>
> ---
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: linux-kbuild@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  scripts/kconfig/symbol.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> index d57f8cbba291..9c5068225328 100644
> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct menu *choice)
>   if (prop->visible.tri == no)
>   continue;
>   def_sym = prop_get_symbol(prop);
> - if (def_sym->visible != no)
> + if (def_sym && def_sym->visible != no)
>   return def_sym;
>   }
> 

The patch is missing the source file's indentation.
(spaces/tabs are lost)

-- 
~Randy


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] kconfig: check for a NULL pointer before access
  2025-05-23  0:07 [PATCH] kconfig: check for a NULL pointer before access Bill Wendling
  2025-05-23  0:16 ` Randy Dunlap
@ 2025-05-23 22:55 ` Bill Wendling
  2025-05-24  0:49   ` [PATCH v3] " Bill Wendling
  1 sibling, 1 reply; 11+ messages in thread
From: Bill Wendling @ 2025-05-23 22:55 UTC (permalink / raw)
  To: Masahiro Yamada, Linux Kbuild mailing list, LKML, Randy Dunlap

The call to 'prop_get_symbol' may return NULL in some cases. The if-then
statement accesses the returned value without checking if it's
non-NULL. After inlining, the compiler may treat the conditional as
'undefined behavior', which the compiler may take the opportunity to do
whatever it wants with the UB path. This patch simply adds a check to
ensure that 'def_sym' is non-NULL to avoid this behavior.

Signed-off-by: Bill Wendling <morbo@google.com>
---
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
v2: Fix whitespaces.
---
 scripts/kconfig/symbol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index d57f8cbba291..9c5068225328 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct menu *choice)
  if (prop->visible.tri == no)
  continue;
  def_sym = prop_get_symbol(prop);
- if (def_sym->visible != no)
+ if (def_sym && def_sym->visible != no)
  return def_sym;
  }

-- 
2.49.0.1164.gab81da1b16-goog

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] kconfig: check for a NULL pointer before access
  2025-05-23  0:16 ` Randy Dunlap
@ 2025-05-23 22:56   ` Bill Wendling
  2025-05-23 23:47     ` Randy Dunlap
  0 siblings, 1 reply; 11+ messages in thread
From: Bill Wendling @ 2025-05-23 22:56 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Masahiro Yamada, Linux Kbuild mailing list, LKML

On Thu, May 22, 2025 at 5:16 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> Hi,
>
> On 5/22/25 5:07 PM, Bill Wendling wrote:
> > The call to 'prop_get_symbol' may return NULL in some cases. The if-then
> > statement accesses the returned value without checking if it's
> > non-NULL. After inlining, the compiler may treat the conditional as
> > 'undefined behavior', which the compiler may take the opportunity to do
> > whatever it wants with the UB path. This patch simply adds a check to
> > ensure that 'def_sym' is non-NULL to avoid this behavior.
> >
> > Signed-off-by: Bill Wendling <morbo@google.com>
> > ---
> > Cc: Masahiro Yamada <masahiroy@kernel.org>
> > Cc: linux-kbuild@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > ---
> >  scripts/kconfig/symbol.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> > index d57f8cbba291..9c5068225328 100644
> > --- a/scripts/kconfig/symbol.c
> > +++ b/scripts/kconfig/symbol.c
> > @@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct menu *choice)
> >   if (prop->visible.tri == no)
> >   continue;
> >   def_sym = prop_get_symbol(prop);
> > - if (def_sym->visible != no)
> > + if (def_sym && def_sym->visible != no)
> >   return def_sym;
> >   }
> >
>
> The patch is missing the source file's indentation.
> (spaces/tabs are lost)
>
Crud! My mailer borked. I sent v2 and it looks to have kept the whitespaces.

-bw

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] kconfig: check for a NULL pointer before access
  2025-05-23 22:56   ` Bill Wendling
@ 2025-05-23 23:47     ` Randy Dunlap
  2025-05-24  0:35       ` Bill Wendling
  0 siblings, 1 reply; 11+ messages in thread
From: Randy Dunlap @ 2025-05-23 23:47 UTC (permalink / raw)
  To: Bill Wendling; +Cc: Masahiro Yamada, Linux Kbuild mailing list, LKML



On 5/23/25 3:56 PM, Bill Wendling wrote:
> On Thu, May 22, 2025 at 5:16 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> Hi,
>>
>> On 5/22/25 5:07 PM, Bill Wendling wrote:
>>> The call to 'prop_get_symbol' may return NULL in some cases. The if-then
>>> statement accesses the returned value without checking if it's
>>> non-NULL. After inlining, the compiler may treat the conditional as
>>> 'undefined behavior', which the compiler may take the opportunity to do
>>> whatever it wants with the UB path. This patch simply adds a check to
>>> ensure that 'def_sym' is non-NULL to avoid this behavior.
>>>
>>> Signed-off-by: Bill Wendling <morbo@google.com>
>>> ---
>>> Cc: Masahiro Yamada <masahiroy@kernel.org>
>>> Cc: linux-kbuild@vger.kernel.org
>>> Cc: linux-kernel@vger.kernel.org
>>> ---
>>>  scripts/kconfig/symbol.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
>>> index d57f8cbba291..9c5068225328 100644
>>> --- a/scripts/kconfig/symbol.c
>>> +++ b/scripts/kconfig/symbol.c
>>> @@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct menu *choice)
>>>   if (prop->visible.tri == no)
>>>   continue;
>>>   def_sym = prop_get_symbol(prop);
>>> - if (def_sym->visible != no)
>>> + if (def_sym && def_sym->visible != no)
>>>   return def_sym;
>>>   }
>>>
>>
>> The patch is missing the source file's indentation.
>> (spaces/tabs are lost)
>>
> Crud! My mailer borked. I sent v2 and it looks to have kept the whitespaces.

I don't think v2 worked either.
See  https://lore.kernel.org/linux-kbuild/CAGG=3QXQkJ6n0J1gZcgxfEb68NWN2y200ZCuxxDtqPRgWPci=A@mail.gmail.com/T/#mf64c7afd19235d3dee4e572f96ff76936f921c6e

-- 
~Randy


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] kconfig: check for a NULL pointer before access
  2025-05-23 23:47     ` Randy Dunlap
@ 2025-05-24  0:35       ` Bill Wendling
  0 siblings, 0 replies; 11+ messages in thread
From: Bill Wendling @ 2025-05-24  0:35 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Masahiro Yamada, Linux Kbuild mailing list, LKML

On Fri, May 23, 2025 at 4:48 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> On 5/23/25 3:56 PM, Bill Wendling wrote:
> > On Thu, May 22, 2025 at 5:16 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> >>
> >> Hi,
> >>
> >> On 5/22/25 5:07 PM, Bill Wendling wrote:
> >>> The call to 'prop_get_symbol' may return NULL in some cases. The if-then
> >>> statement accesses the returned value without checking if it's
> >>> non-NULL. After inlining, the compiler may treat the conditional as
> >>> 'undefined behavior', which the compiler may take the opportunity to do
> >>> whatever it wants with the UB path. This patch simply adds a check to
> >>> ensure that 'def_sym' is non-NULL to avoid this behavior.
> >>>
> >>> Signed-off-by: Bill Wendling <morbo@google.com>
> >>> ---
> >>> Cc: Masahiro Yamada <masahiroy@kernel.org>
> >>> Cc: linux-kbuild@vger.kernel.org
> >>> Cc: linux-kernel@vger.kernel.org
> >>> ---
> >>>  scripts/kconfig/symbol.c | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> >>> index d57f8cbba291..9c5068225328 100644
> >>> --- a/scripts/kconfig/symbol.c
> >>> +++ b/scripts/kconfig/symbol.c
> >>> @@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct menu *choice)
> >>>   if (prop->visible.tri == no)
> >>>   continue;
> >>>   def_sym = prop_get_symbol(prop);
> >>> - if (def_sym->visible != no)
> >>> + if (def_sym && def_sym->visible != no)
> >>>   return def_sym;
> >>>   }
> >>>
> >>
> >> The patch is missing the source file's indentation.
> >> (spaces/tabs are lost)
> >>
> > Crud! My mailer borked. I sent v2 and it looks to have kept the whitespaces.
>
> I don't think v2 worked either.
> See  https://lore.kernel.org/linux-kbuild/CAGG=3QXQkJ6n0J1gZcgxfEb68NWN2y200ZCuxxDtqPRgWPci=A@mail.gmail.com/T/#mf64c7afd19235d3dee4e572f96ff76936f921c6e
>
Goddamnit! I'll try again...

-bw

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3] kconfig: check for a NULL pointer before access
  2025-05-23 22:55 ` [PATCH v2] " Bill Wendling
@ 2025-05-24  0:49   ` Bill Wendling
  2025-05-24  2:13     ` Randy Dunlap
  2025-05-24 17:07     ` Masahiro Yamada
  0 siblings, 2 replies; 11+ messages in thread
From: Bill Wendling @ 2025-05-24  0:49 UTC (permalink / raw)
  To: Bill Wendling, Masahiro Yamada, Linux Kbuild mailing list, LKML,
	Randy Dunlap

The call to 'prop_get_symbol' may return NULL in some cases. The if-then
statement accesses the returned value without cheecking if it's
non-NULL. After inlining, the compiler may treat the conditional as
'undefined behavior', which the compiler may take the opportunity to do
whatever it wants with the UB path. This patch simply adds a check to
ensure that 'def_sym' is non-NULL to avoid this behavior.

Signed-off-by: Bill Wendling <isanbard@gmail.com>
---
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
v3:
  - Fix whitespace for real now.
  - Patch from another email account so that the whitespace is retained.
v2:
  - Fix whitespace
---
  scripts/kconfig/symbol.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index d57f8cbba291..9c5068225328 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct menu *choice)
  		if (prop->visible.tri == no)
  			continue;
  		def_sym = prop_get_symbol(prop);
-		if (def_sym->visible != no)
+		if (def_sym && def_sym->visible != no)
  			return def_sym;
  	}

-- 
2.49.0.1164.gab81da1b16-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v3] kconfig: check for a NULL pointer before access
  2025-05-24  0:49   ` [PATCH v3] " Bill Wendling
@ 2025-05-24  2:13     ` Randy Dunlap
  2025-05-24 17:07     ` Masahiro Yamada
  1 sibling, 0 replies; 11+ messages in thread
From: Randy Dunlap @ 2025-05-24  2:13 UTC (permalink / raw)
  To: Bill Wendling, Bill Wendling, Masahiro Yamada,
	Linux Kbuild mailing list, LKML

Hi Bill,

On 5/23/25 5:49 PM, Bill Wendling wrote:
> The call to 'prop_get_symbol' may return NULL in some cases. The if-then
> statement accesses the returned value without cheecking if it's
> non-NULL. After inlining, the compiler may treat the conditional as
> 'undefined behavior', which the compiler may take the opportunity to do
> whatever it wants with the UB path. This patch simply adds a check to
> ensure that 'def_sym' is non-NULL to avoid this behavior.
> 
> Signed-off-by: Bill Wendling <isanbard@gmail.com>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

although see whitespace issue below...


> ---
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: linux-kbuild@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> v3:
>  - Fix whitespace for real now.
>  - Patch from another email account so that the whitespace is retained.
> v2:
>  - Fix whitespace
> ---
>  scripts/kconfig/symbol.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> index d57f8cbba291..9c5068225328 100644
> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct menu *choice)
>          if (prop->visible.tri == no)
>              continue;
>          def_sym = prop_get_symbol(prop);
> -        if (def_sym->visible != no)
> +        if (def_sym && def_sym->visible != no)
>              return def_sym;
>      }
> 

All of these lines are still indented incorrectly in what I received,
so I downloaded the patch from
https://lore.kernel.org/linux-kbuild/27de0526-0b19-4e14-8c51-1e8b0ddcf490@gmail.com/raw

Running 'patch' (not git) on it gives me:
checking file scripts/kconfig/symbol.c
Hunk #1 FAILED at 272.
1 out of 1 hunk FAILED
done

In looking at the raw patch (link above), the non -/+ lines have
an extra space at the beginning of each line (2 spaces instead of 1).
If I remove one of those spaces, the patch applies cleanly.
Or maybe I could just tell 'patch' to ignore whitespace. Yes, that
also works.

-- 
~Randy

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3] kconfig: check for a NULL pointer before access
  2025-05-24  0:49   ` [PATCH v3] " Bill Wendling
  2025-05-24  2:13     ` Randy Dunlap
@ 2025-05-24 17:07     ` Masahiro Yamada
  2025-05-26  8:08       ` Bill Wendling
  1 sibling, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2025-05-24 17:07 UTC (permalink / raw)
  To: Bill Wendling
  Cc: Bill Wendling, Linux Kbuild mailing list, LKML, Randy Dunlap

On Sat, May 24, 2025 at 9:49 AM Bill Wendling <isanbard@gmail.com> wrote:
>
> The call to 'prop_get_symbol' may return NULL in some cases. The if-then
> statement accesses the returned value without cheecking if it's
> non-NULL. After inlining, the compiler may treat the conditional as
> 'undefined behavior', which the compiler may take the opportunity to do
> whatever it wants with the UB path. This patch simply adds a check to
> ensure that 'def_sym' is non-NULL to avoid this behavior.
>
> Signed-off-by: Bill Wendling <isanbard@gmail.com>


Same reaction to this patch

https://lore.kernel.org/linux-kbuild/20250212154537.235297-1-ant.v.moryakov@gmail.com/


Please attach a test case
that causes a segfault with NULL pointer dereference.











> ---
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: linux-kbuild@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> v3:
>   - Fix whitespace for real now.
>   - Patch from another email account so that the whitespace is retained.
> v2:
>   - Fix whitespace
> ---
>   scripts/kconfig/symbol.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> index d57f8cbba291..9c5068225328 100644
> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct menu *choice)
>                 if (prop->visible.tri == no)
>                         continue;
>                 def_sym = prop_get_symbol(prop);
> -               if (def_sym->visible != no)
> +               if (def_sym && def_sym->visible != no)
>                         return def_sym;
>         }
>
> --
> 2.49.0.1164.gab81da1b16-goog
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3] kconfig: check for a NULL pointer before access
  2025-05-24 17:07     ` Masahiro Yamada
@ 2025-05-26  8:08       ` Bill Wendling
  2025-06-27  0:42         ` [PATCH v4] " Bill Wendling
  0 siblings, 1 reply; 11+ messages in thread
From: Bill Wendling @ 2025-05-26  8:08 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Bill Wendling, Linux Kbuild mailing list, LKML, Randy Dunlap

On Sat, May 24, 2025 at 10:08 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Sat, May 24, 2025 at 9:49 AM Bill Wendling <isanbard@gmail.com> wrote:
> >
> > The call to 'prop_get_symbol' may return NULL in some cases. The if-then
> > statement accesses the returned value without cheecking if it's
> > non-NULL. After inlining, the compiler may treat the conditional as
> > 'undefined behavior', which the compiler may take the opportunity to do
> > whatever it wants with the UB path. This patch simply adds a check to
> > ensure that 'def_sym' is non-NULL to avoid this behavior.
> >
> > Signed-off-by: Bill Wendling <isanbard@gmail.com>
>
> Same reaction to this patch
>
> https://lore.kernel.org/linux-kbuild/20250212154537.235297-1-ant.v.moryakov@gmail.com/
>
I apologize for the whitespace problems. My mailer is crap and
sendmail isn't available on my local machine (it's a long story).

> Please attach a test case
> that causes a segfault with NULL pointer dereference.
>
I don't have a testcase. I discovered this while working on a Clang
feature to isolate paths with undefined behavior. (GCC already has
this pass.) The compiler notices that, after inlining, the path has
UB. It's not necessarily important whether the current compiler messes
up the code path, it's more a matter of *when* the compiler will mess
up the code path, as marking UB paths as "not executable therefore not
executed" is a common trope for some compiler developers.

-bw

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v4] kconfig: check for a NULL pointer before access
  2025-05-26  8:08       ` Bill Wendling
@ 2025-06-27  0:42         ` Bill Wendling
  0 siblings, 0 replies; 11+ messages in thread
From: Bill Wendling @ 2025-06-27  0:42 UTC (permalink / raw)
  To: LKML; +Cc: masahiroy, linux-kbuild, rdunlap, Bill Wendling

The call to 'prop_get_symbol' may return NULL in some cases. The if-then
statement accesses the returned value without cheecking if it's
non-NULL. After inlining, the compiler may treat the conditional as
'undefined behavior', which the compiler may take the opportunity to do
whatever it wants with the UB path. This patch simply adds a check to
ensure that 'def_sym' is non-NULL to avoid this behavior.

Signed-off-by: Bill Wendling <morbo@google.com>
---
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
v4:
  - Fix issue with patch formatting.
  - Patch is sent from original email account.
v3:
  - Fix whitespace for real now.
  - Patch from another email account so that the whitespace is retained.
v2:
  - Fix whitespace
---
 scripts/kconfig/symbol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index d57f8cbba291..9c5068225328 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct menu *choice)
 		if (prop->visible.tri == no)
 			continue;
 		def_sym = prop_get_symbol(prop);
-		if (def_sym->visible != no)
+		if (def_sym && def_sym->visible != no)
 			return def_sym;
 	}
 
-- 
2.50.0.727.gbf7dc18ff4-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-06-27  0:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23  0:07 [PATCH] kconfig: check for a NULL pointer before access Bill Wendling
2025-05-23  0:16 ` Randy Dunlap
2025-05-23 22:56   ` Bill Wendling
2025-05-23 23:47     ` Randy Dunlap
2025-05-24  0:35       ` Bill Wendling
2025-05-23 22:55 ` [PATCH v2] " Bill Wendling
2025-05-24  0:49   ` [PATCH v3] " Bill Wendling
2025-05-24  2:13     ` Randy Dunlap
2025-05-24 17:07     ` Masahiro Yamada
2025-05-26  8:08       ` Bill Wendling
2025-06-27  0:42         ` [PATCH v4] " Bill Wendling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).