Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • stable
  • extraversion
  • early-display
  • variant-emmc-nvme-boot
  • 2024-07-19
  • 2024-06-30
  • 2023-10-18
  • 2023-10-10
  • 2023-07-04
  • 2023-01-25
  • v3
  • variant-emmc-nvme-boot
  • 2020-06-01
14 results

dlmalloc.c

Blame
    • Stephen Warren's avatar
      ee05fedc
      malloc: solve dead code issue in memalign() · ee05fedc
      Stephen Warren authored
      
      The recent change to memalign() caused the allocation failure detection
      code to be dead code; the "retry" logic is always activated under the same
      condition that the original failure detection code is, and also fully
      handles any possible failures. This patch solves the presence of dead
      code.
      
      Two alternatives are possible:
      
      a) Delete the now-dead test, and rely on the "retry" path to handle any
      allocation problems, as it does.
      
      b) Make the "retry" path fall through to the existing (currently dead)
      failure detection code, thus making it not-dead.
      
      (b) was chosen since it reduces the diff between U-Boot's and the upstream
      dlmalloc. This should make it marginally easier to import a new version of
      dlmalloc in the future.
      
      Reported by: Coverity Scan
      Fixes: 4f144a41 ("malloc: work around some memalign fragmentation issues")
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      ee05fedc
      History
      malloc: solve dead code issue in memalign()
      Stephen Warren authored
      
      The recent change to memalign() caused the allocation failure detection
      code to be dead code; the "retry" logic is always activated under the same
      condition that the original failure detection code is, and also fully
      handles any possible failures. This patch solves the presence of dead
      code.
      
      Two alternatives are possible:
      
      a) Delete the now-dead test, and rely on the "retry" path to handle any
      allocation problems, as it does.
      
      b) Make the "retry" path fall through to the existing (currently dead)
      failure detection code, thus making it not-dead.
      
      (b) was chosen since it reduces the diff between U-Boot's and the upstream
      dlmalloc. This should make it marginally easier to import a new version of
      dlmalloc in the future.
      
      Reported by: Coverity Scan
      Fixes: 4f144a41 ("malloc: work around some memalign fragmentation issues")
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>