]> git.karo-electronics.de Git - karo-tx-linux.git/commit
arch: tile: fix null pointer dereference on pt_regs pointer
authorColin Ian King <colin.king@canonical.com>
Mon, 16 Mar 2015 20:14:02 +0000 (16:14 -0400)
committerChris Metcalf <cmetcalf@ezchip.com>
Mon, 16 Mar 2015 20:14:02 +0000 (16:14 -0400)
commit0631818c4f64edc7e57cbd43a17416873350e7b3
tree3be01fda3ed5855cd1be6f2971c6dcbb73e968ff
parent016f7e7081e3a480356e3a041e43a73160816428
arch: tile: fix null pointer dereference on pt_regs pointer

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: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com> [tweaked lightly]
arch/tile/kernel/stack.c