gcov: fix null-pointer dereference for certain module types
commit4e318f43d2ad9a3f5b1054f1388216d8e001f750
authorPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Thu, 9 Sep 2010 23:37:35 +0000 (9 16:37 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:17:53 +0000 (20 13:17 -0700)
treebce967980d900ade14c3f89992c120a2dde61193
parentf4ee150ede7f8ff1a1d8992579c2e1a7e2520815
gcov: fix null-pointer dereference for certain module types

commit 85a0fdfd0f967507f3903e8419bc7e408f5a59de upstream.

The gcov-kernel infrastructure expects that each object file is loaded
only once.  This may not be true, e.g.  when loading multiple kernel
modules which are linked to the same object file.  As a result, loading
such kernel modules will result in incorrect gcov results while unloading
will cause a null-pointer dereference.

This patch fixes these problems by changing the gcov-kernel infrastructure
so that multiple profiling data sets can be associated with one debugfs
entry.  It applies to 2.6.36-rc1.

Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Reported-by: Werner Spies <werner.spies@thalesgroup.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/gcov/fs.c