From: Patrick Palka Date: Wed, 12 Mar 2014 22:40:51 +0000 (-0400) Subject: perf bench: Fix NULL pointer dereference in "perf bench all" X-Git-Tag: v3.14-rc8~4^2^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eeefccdcfc2cc9697562e740bfe6c35fddd4e1c;p=pandora-kernel.git perf bench: Fix NULL pointer dereference in "perf bench all" The for_each_bench() macro must check that the "benchmarks" field of a collection is not NULL before dereferencing it because the "all" collection in particular has a NULL "benchmarks" field (signifying that it has no benchmarks to iterate over). This fixes this NULL pointer dereference when running "perf bench all": [root@ssdandy ~]# perf bench all # Running mem/memset benchmark... # Copying 1MB Bytes ... 2.453675 GB/Sec 12.056327 GB/Sec (with prefault) Segmentation fault (core dumped) [root@ssdandy ~]# Signed-off-by: Patrick Palka Cc: Ingo Molnar Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1394664051-6037-1-git-send-email-patrick@parcs.ath.cx Signed-off-by: Arnaldo Carvalho de Melo --- Reading git-diff-tree failed