tracing/syscalls: Fix perf syscall tracing when syscall_nr == -1
authorWill Deacon <will.deacon@arm.com>
Thu, 16 Aug 2012 17:14:14 +0000 (18:14 +0100)
committerZefan Li <lizefan@huawei.com>
Mon, 2 Feb 2015 09:05:09 +0000 (17:05 +0800)
commit4e6b1b9702836498015705ea4e870aab6b3dc637
treec58ad4ef4acc964f641983100617a0e82f1bc1a4
parent7aff1a05050df389dd41eb1d2b9ade8d9ecb3c6c
tracing/syscalls: Fix perf syscall tracing when syscall_nr == -1

commit 60916a9382e88fbf5e54fd36a3e658efd7ab7bed upstream.

syscall_get_nr can return -1 in the case that the task is not executing
a system call.

This patch fixes perf_syscall_{enter,exit} to check that the syscall
number is valid before using it as an index into a bitmap.

Link: http://lkml.kernel.org/r/1345137254-7377-1-git-send-email-will.deacon@arm.com
Cc: Jason Baron <jbaron@redhat.com>
Cc: Wade Farnsworth <wade_farnsworth@mentor.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Zefan Li <lizefan@huawei.com>
kernel/trace/trace_syscalls.c