The value returned by basehook_device_name is never NULL since scanner always sets yyval to an allocated pointer before returning STRING token. Fixes: b98fee20bfe23 ("mnl: revisit hook listing") Signed-off-by: Phil Sutter --- src/parser_bison.y | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/parser_bison.y b/src/parser_bison.y index 83c0f32322a93..bf2a136796619 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1815,10 +1815,8 @@ basehook_spec : ruleset_spec } | ruleset_spec basehook_device_name { - if ($2) { - $1.obj.name = $2; - $1.obj.location = @2; - } + $1.obj.name = $2; + $1.obj.location = @2; $$ = $1; } ; -- 2.54.0