perf session: Fix possible null pointer dereference in session.c
authorMasanari Iida <standby24x7@gmail.com>
Wed, 14 May 2014 17:13:38 +0000 (02:13 +0900)
committerJiri Olsa <jolsa@kernel.org>
Fri, 16 May 2014 07:18:51 +0000 (09:18 +0200)
commitc5765ece8a050836c6255e1276fc8e0e867078da
treec2cfc515ddacd64fa9be9d1a0ebe8b10596a9ccb
parent9d372ca59bcb9339b4a34a9bf978a1fc15b68b03
perf session: Fix possible null pointer dereference in session.c

cppcheck detected following warning:
[tools/perf/util/session.c:1628] -> [tools/perf/util/session.c:1632]:
 (warning) Possible null pointer dereference: session - otherwise it
 is redundant to check it against null.

In order to avoide null pointer, check the pointer before use.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Link: http://lkml.kernel.org/r/1400087618-13628-1-git-send-email-standby24x7@gmail.com
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
tools/perf/util/session.c