Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • U-Boot U-Boot
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Service Desk
    • Milestones
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • U-BootU-Boot
  • U-BootU-Boot
  • Repository
  • u-boot
  • drivers
  • input
  • input.c
Find file Blame History Permalink
  • Heinrich Schuchardt's avatar
    input: avoid NULL dereference · 2d307fb9
    Heinrich Schuchardt authored Oct 03, 2023 and Tom Rini's avatar Tom Rini committed Oct 11, 2023
    Before using the result of env_get("stdin") we must check if it is NULL.
    
    Avoid #if. This resolves the -Wunused-but-set-variable issue and we don't
    need a dummy assignment in the else branch. Anyway this warning is
    disabled in the Makefile.
    
    For sake of readability use an early return after the configuration check.
    
    Checking CONFIG_SPL_BUILD is incorrect as env_get() is only defined if
    CONFIG_$(SPL_TPL)ENV_SUPPORT=y.
    
    Fixes: 985ca394
    
     ("spl: input: Allow input in SPL and TPL")
    Signed-off-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
    Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    Reviewed-by: default avatarTom Rini <trini@konsulko.com>
    2d307fb9

Imprint & Privacy Policy