• Colin Ian King's avatar
    arch: tile: fix null pointer dereference on pt_regs pointer · 9088616f
    Colin Ian King authored
    Cppcheck reports the following issue:
    [arch/tile/kernel/stack.c:116]: (error) Possible null
      pointer dereference: p
    
    In this case, on reporting on an odd fault, p is set to NULL
    and immediately afterwords p is dereferenced iff
    !kbt->profile is false.  Rather than doing this check just
    return NULL rather than falling through to the potential
    null pointer dereference (since the original intentional
    outcome would be to return NULL anyhow) for this odd fault
    case.
    Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
    Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com> [tweaked lightly]
    9088616f
stack.c 14.1 KB